diff options
author | Marlox <urwid@mx.ouda.fr> | 2016-08-15 13:03:15 +0200 |
---|---|---|
committer | Marlox <urwid@mx.ouda.fr> | 2016-08-15 13:03:15 +0200 |
commit | 982726ef8f48a1dc156b6b7caf7296d1c596530e (patch) | |
tree | 790b2a918f8ebb9a2b9129e5c33c271a6e88d087 /urwid | |
parent | 9a29c4ebd521ae0a3759d72b2ac330d7912289ef (diff) | |
download | urwid-982726ef8f48a1dc156b6b7caf7296d1c596530e.tar.gz |
fix iterator in WidgetContainerListContentsMixin
(x)range is an iterable
__iterator__ should return an iterator (iter(iterable))
Diffstat (limited to 'urwid')
-rwxr-xr-x | urwid/container.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/urwid/container.py b/urwid/container.py index 3999f28..fdd5da4 100755 --- a/urwid/container.py +++ b/urwid/container.py @@ -113,14 +113,14 @@ class WidgetContainerListContentsMixin(object): Return an iterable of positions for this container from first to last. """ - return xrange(len(self.contents)) + return iter(xrange(len(self.contents))) def __reversed__(self): """ Return an iterable of positions for this container from last to first. """ - return xrange(len(self.contents) - 1, -1, -1) + return iter(xrange(len(self.contents) - 1, -1, -1)) class GridFlowError(Exception): |