Skip to content

Commit 17f6eae

Browse files
committed
Use next(iter)
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 12aaf9b commit 17f6eae

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

bpython/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ def tab(self, back=False):
14531453
# 4. swap current word for a match list item
14541454
elif self.matches_iter.matches:
14551455
current_match = back and self.matches_iter.previous() \
1456-
or self.matches_iter.next()
1456+
or next(self.matches_iter)
14571457
try:
14581458
self.show_list(self.matches_iter.matches, topline=self.argspec,
14591459
formatter=self.matches_iter.completer.format,

bpython/curtsiesfrontend/repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def only_whitespace_left_of_cursor():
668668

669669
elif self.matches_iter.matches:
670670
self.current_match = back and self.matches_iter.previous() \
671-
or self.matches_iter.next()
671+
or next(self.matches_iter)
672672
self._cursor_offset, self._current_line = self.matches_iter.cur_line()
673673
# using _current_line so we don't trigger a completion reset
674674
self.list_win_visible = True

bpython/test/test_crashers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self):
5959
self.data = ""
6060
self.delayed_call = None
6161
self.states = iter(self.STATES)
62-
self.state = self.states.next()
62+
self.state = next(self.states)
6363

6464
def outReceived(self, data):
6565
self.data += data
@@ -74,7 +74,7 @@ def next(self):
7474
if index >= 0:
7575
self.data = self.data[index + 4:]
7676
self.transport.write(input)
77-
self.state = self.states.next()
77+
self.state = next(self.states)
7878
else:
7979
self.transport.closeStdin()
8080
if self.transport.pid is not None:

bpython/urwid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ def tab(self, back=False):
11071107
if back:
11081108
self.matches_iter.previous()
11091109
else:
1110-
self.matches_iter.next()
1110+
next(self.matches_iter)
11111111
cursor, text = self.matches_iter.cur_line()
11121112
self.edit.set_edit_text(text)
11131113
self.edit.edit_pos = cursor

0 commit comments

Comments
 (0)