Commit 47dc7734 authored by Robert Bradshaw's avatar Robert Bradshaw

Debug flag for raising an exception on an error.

parent 4658cbdc
...@@ -3,14 +3,17 @@ debug_temp_alloc = 0 ...@@ -3,14 +3,17 @@ debug_temp_alloc = 0
debug_coercion = 0 debug_coercion = 0
# Write comments into the C code that show where temporary variables # Write comments into the C code that show where temporary variables
# are allocated and released # are allocated and released.
debug_temp_code_comments = 0 debug_temp_code_comments = 0
# Write a call trace of the code generation phase into the C code # Write a call trace of the code generation phase into the C code.
debug_trace_code_generation = 0 debug_trace_code_generation = 0
# Do not replace exceptions with user-friendly error messages # Do not replace exceptions with user-friendly error messages.
debug_no_exception_intercept = 0 debug_no_exception_intercept = 0
# Print a message each time a new stage in the pipeline is entered # Print a message each time a new stage in the pipeline is entered.
debug_verbose_pipeline = 0 debug_verbose_pipeline = 0
# Raise an exception when an error is encountered.
debug_exception_on_error = 0
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import sys import sys
from Cython.Utils import open_new_file from Cython.Utils import open_new_file
from DebugFlags import debug_exception_on_error
class PyrexError(Exception): class PyrexError(Exception):
...@@ -143,7 +144,7 @@ def error(position, message): ...@@ -143,7 +144,7 @@ def error(position, message):
if position is None: if position is None:
raise InternalError(message) raise InternalError(message)
err = CompileError(position, message) err = CompileError(position, message)
#if position is not None: raise Exception(err) # debug if debug_exception_on_error: raise Exception(err) # debug
report_error(err) report_error(err)
return err return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment