~brandon753-ba/duplicity/aws-glacier

« back to all changes in this revision

Viewing changes to duplicity/lazy.py

  • Committer: kenneth at loafman
  • Date: 2019-02-25 16:07:35 UTC
  • mfrom: (1340.2.11 duplicity)
  • Revision ID: kenneth@loafman.com-20190225160735-icd56h2nebsi0g91
* Merged in  lp:~mgorse/duplicity/0.8-series
  - More changes for unicode and py3 support

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
 
207
207
        def make_iterator(fork_num):
208
208
            while(1):
209
 
                yield get_next(fork_num)
 
209
                try:
 
210
                    ret = get_next(fork_num)
 
211
                except StopIteration:
 
212
                    return
 
213
                yield ret
210
214
 
211
215
        return tuple(map(make_iterator, list(range(num_of_forks))))
212
216
 
230
234
        while(1):
231
235
            if self.a_leading_by >= 0:
232
236
                # a is in front, add new element
233
 
                elem = next(iter)  # exception will be passed
 
237
                try:
 
238
                    elem = next(iter)
 
239
                except StopIteration:
 
240
                    return
234
241
                buf.append(elem)
235
242
            else:
236
243
                # b is in front, subtract an element
244
251
        while(1):
245
252
            if self.a_leading_by <= 0:
246
253
                # b is in front, add new element
247
 
                elem = next(iter)  # exception will be passed
 
254
                try:
 
255
                    elem = next(iter)
 
256
                except StopIteration:
 
257
                    return
248
258
                buf.append(elem)
249
259
            else:
250
260
                # a is in front, subtract an element