aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYannick CouziniƩ <yannick.couzinie@cognostics.de>2018-08-06 21:07:21 +0200
committerYannick CouziniƩ <yannick.couzinie@cognostics.de>2018-08-06 21:07:21 +0200
commit2923398f5049a27fa509d5d5c287e9be089514fa (patch)
treef4346b8eb7317ad07ebd7f36b55af30c88e3e7d7
parentbb277d1eff052e2478fb8c132bc42793ce91b870 (diff)
downloadranger-2923398f5049a27fa509d5d5c287e9be089514fa.tar.gz
Replace StopIteration with bare return
A bare return in generators raises StopIteration (this is backwards compatible). Using StopIteration raised a warning in 3.6.x and raises an Error in 3.7.0 (and probably upwards).
-rw-r--r--ranger/gui/widgets/pager.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py
index 9afbfd15..d64d4ac1 100644
--- a/ranger/gui/widgets/pager.py
+++ b/ranger/gui/widgets/pager.py
@@ -234,7 +234,7 @@ class Pager(Widget): # pylint: disable=too-many-instance-attributes
def _generate_lines(self, starty, startx):
i = starty
if not self.source:
- raise StopIteration
+ return
while True:
try:
line = self._get_line(i).expandtabs(4)
@@ -244,5 +244,5 @@ class Pager(Widget): # pylint: disable=too-many-instance-attributes
line = line[startx:self.wid + startx]
yield line.rstrip().replace('\r\n', '\n')
except IndexError:
- raise StopIteration
+ return
i += 1