summaryrefslogtreecommitdiff
path: root/giscanner/girparser.py
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-04-28 23:33:59 -0700
committerThomas A Caswell <tcaswell@gmail.com>2015-09-29 14:43:14 -0400
commitd9a9f70ef6e3b1ef0f4baccf94780d286e51bbb0 (patch)
treecf2fbae8e6364e521da2132cbefed09ff636b404 /giscanner/girparser.py
parenta75e72763a52757daea4c1f917dc2922029a3af5 (diff)
downloadgobject-introspection-d9a9f70ef6e3b1ef0f4baccf94780d286e51bbb0.tar.gz
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
Diffstat (limited to 'giscanner/girparser.py')
-rw-r--r--giscanner/girparser.py6
1 files changed, 3 insertions, 3 deletions
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)