From d9a9f70ef6e3b1ef0f4baccf94780d286e51bbb0 Mon Sep 17 00:00:00 2001 From: Simon Feltman Date: Mon, 28 Apr 2014 23:33:59 -0700 Subject: giscanner: Convert map() results to list Convert the results map() calls to a list for Python 3 compatibility. In Python 3, map() returns an iterable "map object" which does not allow indexing or iteration more than once. https://bugzilla.gnome.org/show_bug.cgi?id=679438 --- giscanner/girparser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'giscanner/girparser.py') diff --git a/giscanner/girparser.py b/giscanner/girparser.py index 76dc5afb..248e223a 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -455,8 +455,8 @@ class GIRParser(object): return ast.Type(ctype=ctype) elif name in ['GLib.List', 'GLib.SList']: subchild = self._find_first_child(typenode, - map(_corens, ('callback', 'array', - 'varargs', 'type'))) + list(map(_corens, ('callback', 'array', + ' varargs', 'type')))) if subchild is not None: element_type = self._parse_type(typenode) else: @@ -464,7 +464,7 @@ class GIRParser(object): return ast.List(name, element_type, ctype=ctype) elif name == 'GLib.HashTable': subchildren = self._find_children(typenode, _corens('type')) - subchildren_types = map(self._parse_type_simple, subchildren) + subchildren_types = list(map(self._parse_type_simple, subchildren)) while len(subchildren_types) < 2: subchildren_types.append(ast.TYPE_ANY) return ast.Map(subchildren_types[0], subchildren_types[1], ctype=ctype) -- cgit v1.2.1