~bmerry/duplicity/pydrive-regular

« back to all changes in this revision

Viewing changes to duplicity/librsync.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:
90
90
            self._add_to_inbuf()
91
91
        try:
92
92
            self.eof, len_inbuf_read, cycle_out = self.maker.cycle(self.inbuf)
93
 
        except _librsync.librsyncError, e:
 
93
        except _librsync.librsyncError as e:
94
94
            raise librsyncError(str(e))
95
95
        self.inbuf = self.inbuf[len_inbuf_read:]
96
96
        self.outbuf.fromstring(cycle_out)
126
126
        LikeFile.__init__(self, infile)
127
127
        try:
128
128
            self.maker = _librsync.new_sigmaker(blocksize)
129
 
        except _librsync.librsyncError, e:
 
129
        except _librsync.librsyncError as e:
130
130
            raise librsyncError(str(e))
131
131
 
132
132
class DeltaFile(LikeFile):
148
148
            assert not signature.close()
149
149
        try:
150
150
            self.maker = _librsync.new_deltamaker(sig_string)
151
 
        except _librsync.librsyncError, e:
 
151
        except _librsync.librsyncError as e:
152
152
            raise librsyncError(str(e))
153
153
 
154
154
 
167
167
            raise TypeError("basis_file must be a (true) file")
168
168
        try:
169
169
            self.maker = _librsync.new_patchmaker(basis_file)
170
 
        except _librsync.librsyncError, e:
 
170
        except _librsync.librsyncError as e:
171
171
            raise librsyncError(str(e))
172
172
 
173
173
 
182
182
        """Return new signature instance"""
183
183
        try:
184
184
            self.sig_maker = _librsync.new_sigmaker(blocksize)
185
 
        except _librsync.librsyncError, e:
 
185
        except _librsync.librsyncError as e:
186
186
            raise librsyncError(str(e))
187
187
        self.gotsig = None
188
188
        self.buffer = ""
201
201
        """Run self.buffer through sig_maker, add to self.sig_string"""
202
202
        try:
203
203
            eof, len_buf_read, cycle_out = self.sig_maker.cycle(self.buffer)
204
 
        except _librsync.librsyncError, e:
 
204
        except _librsync.librsyncError as e:
205
205
            raise librsyncError(str(e))
206
206
        self.buffer = self.buffer[len_buf_read:]
207
207
        self.sigstring_list.append(cycle_out)