From 4e91e6bd19c0389237c0be68e44afef70d1ccd22 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Fri, 24 Sep 2010 09:57:06 -0300 Subject: [maintransformer] Use AssertionError --- giscanner/maintransformer.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index a670a0a2..03649867 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 -- cgit v1.2.1