From: Dag Sverre Seljebotn Date: Sat, 28 Mar 2009 14:09:02 +0000 (+0100) Subject: Debug flag to not intercept pipeline exceptions X-Git-Tag: 0.12.alpha0~353 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f78e64cbeb4815d2e399e3e92b2ea43131d3e5dc;p=cython.git Debug flag to not intercept pipeline exceptions --- diff --git a/Cython/Compiler/DebugFlags.py b/Cython/Compiler/DebugFlags.py index d43f5d1a..0e80338e 100644 --- a/Cython/Compiler/DebugFlags.py +++ b/Cython/Compiler/DebugFlags.py @@ -8,3 +8,6 @@ debug_temp_code_comments = 0 # Write a call trace of the code generation phase into the C code debug_trace_code_generation = 0 + +# Do not replace exceptions with user-friendly error messages +debug_no_exception_intercept = 0 diff --git a/Cython/Compiler/Visitor.py b/Cython/Compiler/Visitor.py index c7739f8d..220179d0 100644 --- a/Cython/Compiler/Visitor.py +++ b/Cython/Compiler/Visitor.py @@ -7,6 +7,7 @@ import Nodes import ExprNodes import Naming import Errors +import DebugFlags from StringEncoding import EncodedString class BasicVisitor(object): @@ -151,6 +152,8 @@ class TreeVisitor(BasicVisitor): raise except Exception, e: import sys + if DebugFlags.debug_no_exception_intercept: + raise trace = [''] for parent, attribute, index in self.access_path: node = getattr(parent, attribute)