summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2017-07-17 12:38:37 +0200
committerStefan Behnel <stefan_ml@behnel.de>2017-07-17 12:38:37 +0200
commit1f122aca59d8d9ec20d173ba5be430b4a9ef362a (patch)
tree5441425f9c4cec58c0af5dd54d9bea1ccd542e0f
parent13a88f9558886b91cde838d29e226d76bac1b099 (diff)
downloadcython-1f122aca59d8d9ec20d173ba5be430b4a9ef362a.tar.gz
allow enabling/disabling C line display in tracebacks with a new C compile time macro CYTHON_CLINE_IN_TRACEBACK=0/1
-rw-r--r--Cython/Utility/Exceptions.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Cython/Utility/Exceptions.c b/Cython/Utility/Exceptions.c
index 5cc57ed8f..f0819d7bb 100644
--- a/Cython/Utility/Exceptions.c
+++ b/Cython/Utility/Exceptions.c
@@ -538,6 +538,9 @@ static int __Pyx_CLineForTraceback(int c_line);
//@substitute: naming
static int __Pyx_CLineForTraceback(int c_line) {
+#ifdef CYTHON_CLINE_IN_TRACEBACK /* 0 or 1 to disable/enable C line display in tracebacks at C compile time */
+ return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
+#else
PyObject *ptype, *pvalue, *ptraceback;
PyObject *use_cline;
@@ -553,6 +556,7 @@ static int __Pyx_CLineForTraceback(int c_line) {
Py_XDECREF(use_cline);
PyErr_Restore(ptype, pvalue, ptraceback);
return c_line;
+#endif
}
/////////////// AddTraceback.proto ///////////////