Skip to content

Commit

Permalink
next() in 2.7 vs __next()__ in 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienG committed Mar 29, 2018
1 parent 6cc990b commit 9255d27
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iss/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,14 @@ def reservoir(records, record_list, n=None):
for sample in samples:
while x < sample:
x += 1
_ = records.__next__()
record = records.__next__()
if sys.version_info > (3,):
_ = records.__next__()
else:
_ = records.next() # I hate python2
if sys.version_info > (3,):
record = records.__next__()
else:
record = records.next()
x += 1
yield record
else:
Expand Down

0 comments on commit 9255d27

Please sign in to comment.