~bmerry/duplicity/pydrive-regular

« back to all changes in this revision

Viewing changes to duplicity/backends/dpbxbackend.py

  • Committer: Michael Terry
  • Date: 2014-04-17 20:50:57 UTC
  • mto: This revision was merged to the branch mainline in revision 975.
  • Revision ID: michael.terry@canonical.com-20140417205057-4cxo1yebh0oer02a
Solve except 2to3 fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
            try:
82
82
                return f(self, *args)
83
 
            except TypeError, e:
 
83
            except TypeError as e:
84
84
                log_exception(e)
85
85
                log.FatalError('dpbx type error "%s"' % (e,), log.ErrorCode.backend_code_error)
86
 
            except rest.ErrorResponse, e:
 
86
            except rest.ErrorResponse as e:
87
87
                msg = e.user_error_msg or str(e)
88
88
                log.Error('dpbx error: %s' % (msg,), log.ErrorCode.backend_command_error)
89
89
                raise e
90
 
            except Exception, e:
 
90
            except Exception as e:
91
91
                log_exception(e)
92
92
                log.Error('dpbx code error "%s"' % (e,), log.ErrorCode.backend_code_error)
93
93
                raise e
159
159
        if not self.sess.is_linked():
160
160
          try: # to login to the box
161
161
            self.sess.link()
162
 
          except rest.ErrorResponse, e:
 
162
          except rest.ErrorResponse as e:
163
163
            log.FatalError('dpbx Error: %s\n' % str(e), log.ErrorCode.dpbx_nologin)
164
164
          if not self.sess.is_linked(): # stil not logged in
165
165
            log.FatalError("dpbx Cannot login: check your credentials",log.ErrorCode.dpbx_nologin)