/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/iterablefile.py

  • Committer: Martin
  • Date: 2017-05-25 01:35:55 UTC
  • mto: This revision was merged to the branch mainline in revision 6637.
  • Revision ID: gzlist@googlemail.com-20170525013555-lepzczdnzb9r272j
Apply 2to3 next fixer and make compatible

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        result = self._buffer
68
68
        while result_length(result) is None:
69
69
            try:
70
 
                result += self._iter.next()
 
70
                result += next(self._iter)
71
71
            except StopIteration:
72
72
                self.done = True
73
73
                self._buffer = ""
142
142
        """
143
143
        self._check_closed()
144
144
 
145
 
    def next(self):
 
145
    def __next__(self):
146
146
        """Implementation of the iterator protocol's next()
147
147
 
148
148
        >>> f = IterableFile(['This \\n', 'is ', 'a ', 'test.'])
149
 
        >>> f.next()
 
149
        >>> next(f)
150
150
        'This \\n'
151
151
        >>> f.close()
152
 
        >>> f.next()
 
152
        >>> next(f)
153
153
        Traceback (most recent call last):
154
154
        ValueError: File is closed.
155
155
        >>> f = IterableFile(['This \\n', 'is ', 'a ', 'test.\\n'])
156
 
        >>> f.next()
 
156
        >>> next(f)
157
157
        'This \\n'
158
 
        >>> f.next()
 
158
        >>> next(f)
159
159
        'is a test.\\n'
160
 
        >>> f.next()
 
160
        >>> next(f)
161
161
        Traceback (most recent call last):
162
162
        StopIteration
163
163
        """
164
164
        self._check_closed()
165
 
        return self._iter.next()
 
165
        return next(self._iter)
 
166
 
 
167
    next = __next__
166
168
 
167
169
    def __iter__(self):
168
170
        """