[gobject-introspection] [maintransformer] Use AssertionError
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] [maintransformer] Use AssertionError
- Date: Fri, 24 Sep 2010 14:16:27 +0000 (UTC)
commit 4e91e6bd19c0389237c0be68e44afef70d1ccd22
Author: Johan Dahlin <johan gnome org>
Date: Fri Sep 24 09:57:06 2010 -0300
[maintransformer] Use AssertionError
giscanner/maintransformer.py | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index a670a0a..0364986 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -198,7 +198,7 @@ usage is void (*_gtk_reserved1)(void);"""
elif isinstance(node, ast.Registered) and node.gtype_name is not None:
return node.gtype_name
return node.c_name
- assert False, "Unhandled node %r" % (node, )
+ raise AssertionError("Unhandled node %r" % (node, ))
def _get_block(self, node):
return self._blocks.get(self._get_annotation_name(node))
@@ -435,7 +435,7 @@ usage is void (*_gtk_reserved1)(void);"""
elif isinstance(target, (ast.Record, ast.Union)):
return ast.PARAM_TRANSFER_FULL
else:
- assert False, "Invalid constructor"
+ raise AssertionError("Invalid constructor")
elif isinstance(target, (ast.Class, ast.Record, ast.Union)):
# Explicitly no default for these
return None
@@ -483,9 +483,6 @@ usage is void (*_gtk_reserved1)(void);"""
caller_allocates = True
elif subtype == 'callee-allocates':
caller_allocates = False
- else:
- message.fatal("out allocation for %s is invalid (%r)" % (
- node, subtype))
elif OPT_IN in options:
annotated_direction = ast.PARAM_DIRECTION_IN
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]