diff options
author | Stefan Behnel <scoder@users.berlios.de> | 2011-01-17 17:11:55 +0100 |
---|---|---|
committer | Stefan Behnel <scoder@users.berlios.de> | 2011-01-17 17:11:55 +0100 |
commit | 9eee898ce75c59765e367cdcff9db2b55ad4d73f (patch) | |
tree | 71792d3d91adbd847f12c323ac40c167bbdd53e2 /Cython/Distutils | |
parent | 38a051cb15bc728d4d17b716a1b67ae8d1d375d0 (diff) | |
download | cython-9eee898ce75c59765e367cdcff9db2b55ad4d73f.tar.gz |
patch for ticket #646 by klepa: provide dedicated switches for 'c_line_in_traceback' option
Diffstat (limited to 'Cython/Distutils')
-rw-r--r-- | Cython/Distutils/build_ext.py | 4 | ||||
-rw-r--r-- | Cython/Distutils/extension.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Cython/Distutils/build_ext.py b/Cython/Distutils/build_ext.py index 94673633a..4b07fbdfa 100644 --- a/Cython/Distutils/build_ext.py +++ b/Cython/Distutils/build_ext.py @@ -110,6 +110,7 @@ class build_ext(_build_ext.build_ext): self.pyrex_c_in_temp = 0 self.pyrex_gen_pxi = 0 self.pyrex_gdb = False + self.no_c_in_traceback = 0 def finalize_options (self): _build_ext.build_ext.finalize_options(self) @@ -185,6 +186,8 @@ class build_ext(_build_ext.build_ext): getattr(extension, 'pyrex_create_listing', 0) line_directives = self.pyrex_line_directives or \ getattr(extension, 'pyrex_line_directives', 0) + no_c_in_traceback = self.no_c_in_traceback or \ + getattr(extension, 'no_c_in_traceback', 0) cplus = self.pyrex_cplus or getattr(extension, 'pyrex_cplus', 0) or \ (extension.language and extension.language.lower() == 'c++') pyrex_gen_pxi = self.pyrex_gen_pxi or getattr(extension, 'pyrex_gen_pxi', 0) @@ -274,6 +277,7 @@ class build_ext(_build_ext.build_ext): output_file = target, cplus = cplus, emit_linenums = line_directives, + c_line_in_traceback = not no_c_in_traceback, generate_pxi = pyrex_gen_pxi, output_dir = output_dir, gdb_debug = pyrex_gdb) diff --git a/Cython/Distutils/extension.py b/Cython/Distutils/extension.py index 05528917e..52beb8ff2 100644 --- a/Cython/Distutils/extension.py +++ b/Cython/Distutils/extension.py @@ -33,6 +33,8 @@ class Extension(_Extension.Extension): generate .pxi file for public declarations pyrex_gdb : boolean generate Cython debug information for this extension for cygdb + no_c_in_traceback : boolean + emit the c file and line number from the traceback for exceptions """ # When adding arguments to this constructor, be sure to update @@ -59,6 +61,7 @@ class Extension(_Extension.Extension): pyrex_c_in_temp = 0, pyrex_gen_pxi = 0, pyrex_gdb = False, + no_c_in_traceback = False, **kw): _Extension.Extension.__init__(self, name, sources, @@ -85,6 +88,7 @@ class Extension(_Extension.Extension): self.pyrex_c_in_temp = pyrex_c_in_temp self.pyrex_gen_pxi = pyrex_gen_pxi self.pyrex_gdb = pyrex_gdb + self.no_c_in_traceback = no_c_in_traceback # class Extension |