PEP-3333: LatinIter.__next__ should call self._next before testing self.transform_ok (#2128)

This commit is contained in:
Marc Swingler 2021-11-01 15:47:24 -07:00 committed by GitHub
parent 0cd7acd5a3
commit 1acde901b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -424,10 +424,11 @@ a block boundary.)
return self
def __next__(self):
data = self._next()
if self.transform_ok:
return piglatin(self._next()) # call must be byte-safe on Py3
return piglatin(data) # call must be byte-safe on Py3
else:
return self._next()
return data
class Latinator: