From: Lisandro Dalcin Date: Tue, 5 Apr 2011 17:29:36 +0000 (-0300) Subject: additional fix and test for ticket #650 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb0f739ffb5563c005573939ac076ce78c3e79a8;p=cython.git additional fix and test for ticket #650 --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index bdb524cf..e7c3bd4f 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -4145,7 +4145,9 @@ class RaiseStatNode(StatNode): if self.exc_type and not self.exc_value and not self.exc_tb: exc = self.exc_type import ExprNodes - if isinstance(exc, ExprNodes.SimpleCallNode) and not exc.args: + if (isinstance(exc, ExprNodes.SimpleCallNode) and + not (exc.args or (exc.arg_tuple is not None and + exc.arg_tuple.args))): exc = exc.function # extract the exception type if exc.is_name and exc.entry.is_builtin: self.builtin_exc_name = exc.name diff --git a/tests/run/raise_memory_error_T650.pyx b/tests/run/raise_memory_error_T650.pyx index 1fcc7627..065faf2c 100644 --- a/tests/run/raise_memory_error_T650.pyx +++ b/tests/run/raise_memory_error_T650.pyx @@ -23,3 +23,12 @@ def raise_me_instance(): ... else: print('NOT RAISED!') """ raise MemoryError() + +def raise_me_instance_value(): + """ + >>> raise_me_instance_value() + Traceback (most recent call last): + ... + MemoryError: oom + """ + raise MemoryError("oom")