From: José Fonseca Date: Thu, 25 Jun 2009 12:56:57 +0000 (+0100) Subject: Allow failure handling for functions without return value. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=243772e78d059f45fe98079b6b7b653f5fcdcfe2;p=apitrace Allow failure handling for functions without return value. --- 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);'