Whoops, missed a Python 3 change (__next__).

This commit is contained in:
Phillip J. Eby 2011-01-13 15:51:34 +00:00
parent 56dcd4ff1e
commit 281486c0a2
1 changed files with 2 additions and 2 deletions

View File

@ -417,13 +417,13 @@ a block boundary.)
def __init__(self, result, transform_ok): def __init__(self, result, transform_ok):
if hasattr(result, 'close'): if hasattr(result, 'close'):
self.close = result.close self.close = result.close
self._next = iter(result).next self._next = iter(result).__next__
self.transform_ok = transform_ok self.transform_ok = transform_ok
def __iter__(self): def __iter__(self):
return self return self
def next(self): def __next__(self):
if self.transform_ok: if self.transform_ok:
return piglatin(self._next()) # call must be byte-safe on Py3 return piglatin(self._next()) # call must be byte-safe on Py3
else: else: