Skip to content

Commit 52b0ff9

Browse files
authored
Handling of __next__ and next by future.utils.get_next was reversed
I assume nobody is using future.utils.get_next, because the builtin next() function exists from Python 2.6 on and meets most needs, and because nobody has noticed this before. Fixing in case it saves anyone confusion in future.
1 parent 01a1d31 commit 52b0ff9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/future/utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,9 @@ def __next__(self):
527527
return cls
528528

529529
if PY3:
530-
get_next = lambda x: x.next
531-
else:
532530
get_next = lambda x: x.__next__
531+
else:
532+
get_next = lambda x: x.next
533533

534534

535535
def encode_filename(filename):

0 commit comments

Comments
 (0)