Mercurial > public > mercurial-scm > hg
comparison mercurial/peer.py @ 29216:ead25aa27a43
py3: convert to next() function
next(..) was introduced in py2.6 and .next() is not available in py3
https://docs.python.org/2/library/functions.html#next
author | timeless <timeless@mozdev.org> |
---|---|
date | Mon, 16 May 2016 21:30:53 +0000 |
parents | 8d38eab2777a |
children | e2fc2122029c |
comparison
equal
deleted
inserted
replaced
29215:f5983805574e | 29216:ead25aa27a43 |
---|---|
96 which is used by remotebatch to split the call into separate encoding and | 96 which is used by remotebatch to split the call into separate encoding and |
97 decoding phases. | 97 decoding phases. |
98 ''' | 98 ''' |
99 def plain(*args, **opts): | 99 def plain(*args, **opts): |
100 batchable = f(*args, **opts) | 100 batchable = f(*args, **opts) |
101 encargsorres, encresref = batchable.next() | 101 encargsorres, encresref = next(batchable) |
102 if not encresref: | 102 if not encresref: |
103 return encargsorres # a local result in this case | 103 return encargsorres # a local result in this case |
104 self = args[0] | 104 self = args[0] |
105 encresref.set(self._submitone(f.func_name, encargsorres)) | 105 encresref.set(self._submitone(f.func_name, encargsorres)) |
106 return batchable.next() | 106 return next(batchable) |
107 setattr(plain, 'batchable', f) | 107 setattr(plain, 'batchable', f) |
108 return plain | 108 return plain |
109 | 109 |
110 class peerrepository(object): | 110 class peerrepository(object): |
111 | 111 |