diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-04 18:59:13 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-09-04 18:59:13 +0000 |
| commit | 6eef8e01c7654acf417d3ad81fb6cb5cfc6edc2f (patch) | |
| tree | afb7bcf88b0d95bf242e5d3a9ebf7299df1b7da4 /lldb/scripts/Python/python-extensions.swig | |
| parent | 24223eb24c74a116e1a3eb704d28e61454719a74 (diff) | |
| download | bcm5719-llvm-6eef8e01c7654acf417d3ad81fb6cb5cfc6edc2f.tar.gz bcm5719-llvm-6eef8e01c7654acf417d3ad81fb6cb5cfc6edc2f.zip | |
[Python] Implement __next__ for value_iter
Python 3 iteration calls the next() method instead of next() and
value_iter only implemented the Python 2 version.
Differential revision: https://reviews.llvm.org/D67184
llvm-svn: 370954
Diffstat (limited to 'lldb/scripts/Python/python-extensions.swig')
| -rw-r--r-- | lldb/scripts/Python/python-extensions.swig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig index 13bb5821cda..7823dc4ad1a 100644 --- a/lldb/scripts/Python/python-extensions.swig +++ b/lldb/scripts/Python/python-extensions.swig @@ -946,13 +946,16 @@ class value_iter(object): def __iter__(self): return self - def next(self): + def __next__(self): if self.index >= self.length: raise StopIteration() child_sbvalue = self.sbvalue.GetChildAtIndex(self.index) self.index += 1 return value(child_sbvalue) + def next(self): + return self.__next__() + def __init__(self,value): self.index = 0 self.sbvalue = value |

