summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-20 00:09:08 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-20 00:10:04 -0300
commit2a70a474c2960496643cf5879158bea26c5648fa (patch)
treeeab124ef9d4a697d4a541006e314a75016d89ed7
parent597ce27a0984669997a65fd216d5ce45dbcbfa6b (diff)
[maintransformer] Make warning more robustHEADmaster
Instead of assuming that a parent node is always passed in, make sure to handle that case. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629959
-rw-r--r--giscanner/maintransformer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index e069a2e..533db8f 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -285,10 +285,10 @@ usage is void (*_gtk_reserved1)(void);"""
if not result.resolved:
parent = orig_node
- if isinstance(parent, ast.Function):
+ if parent is not None and isinstance(parent, ast.Function):
text = parent.symbol
else:
- text = parent.name
+ text = type_str
message.warn_node(parent, "%s: Unknown type: %r" %
(text, result.ctype))
return result