diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-24 02:24:17 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-03-10 19:05:19 +0530 |
commit | 3a7d3eee01dd5213547290c2b01db0810d4f50cc (patch) | |
tree | b59d4bfcfe611ccea21bac93692859a8b7f36a06 /giscanner/gdumpparser.py | |
parent | aae69e73eb3ce04f643e9697e46823e41cdb4eea (diff) | |
download | gobject-introspection-3a7d3eee01dd5213547290c2b01db0810d4f50cc.tar.gz |
giscanner: Remove custom collections implementation
We already require python 2.7, and it has OrderedDict and Counter.
Besides cleaning up unmaintained code, this change found and fixed
a Python 3 bug where we were iterating over a dict while changing it.
Diffstat (limited to 'giscanner/gdumpparser.py')
-rw-r--r-- | giscanner/gdumpparser.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py index 1134f33e..bd4d233a 100644 --- a/giscanner/gdumpparser.py +++ b/giscanner/gdumpparser.py @@ -89,12 +89,12 @@ class GDumpParser(object): """ # First pass: parsing - for node in self._namespace.values(): + for node in list(self._namespace.values()): if isinstance(node, ast.Function): self._initparse_function(node) if self._namespace.name == 'GObject' or self._namespace.name == 'GLib': - for node in self._namespace.values(): + for node in list(self._namespace.values()): if isinstance(node, ast.Record): self._initparse_gobject_record(node) @@ -123,7 +123,7 @@ class GDumpParser(object): # Pair up boxed types and class records for name, boxed in self._boxed_types.items(): self._pair_boxed_type(boxed) - for node in self._namespace.values(): + for node in list(self._namespace.values()): if isinstance(node, (ast.Class, ast.Interface)): self._find_class_record(node) |