From 243772e78d059f45fe98079b6b7b653f5fcdcfe2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 25 Jun 2009 13:56:57 +0100 Subject: [PATCH] Allow failure handling for functions without return value. --- base.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/base.py b/base.py index c27a3c2..24641bc 100644 --- a/base.py +++ b/base.py @@ -289,8 +289,12 @@ class Function: def fail_impl(self): if self.fail is not None: - assert self.type is not Void - print ' return %s;' % self.fail + if self.type is Void: + assert self.fail == '' + print ' return;' + else: + assert self.fail != '' + print ' return %s;' % self.fail else: print ' ExitProcess(0);' -- 2.45.2