diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2016-07-31 09:10:52 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2016-07-31 09:16:01 +0200 |
commit | 9a3f96e8109ae0c00c763a4878e871b9d0d06e59 (patch) | |
tree | 3647088775e58b086a3706ca8728a36379571e53 | |
parent | 7fa5990c78dd8a30b66881f58c9947399484e493 (diff) | |
download | cython-9a3f96e8109ae0c00c763a4878e871b9d0d06e59.tar.gz |
add macro indirections that apparently help making pyston happier
-rw-r--r-- | Cython/Utility/Builtins.c | 2 | ||||
-rw-r--r-- | Cython/Utility/Exceptions.c | 2 | ||||
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/Cython/Utility/Builtins.c b/Cython/Utility/Builtins.c index 645bf6772..3dabc6289 100644 --- a/Cython/Utility/Builtins.c +++ b/Cython/Utility/Builtins.c @@ -115,7 +115,7 @@ static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) } if (PyCode_Check(o)) { - if (PyCode_GetNumFree((PyCodeObject *)o) > 0) { + if (__Pyx_PyCode_HasFreeVars((PyCodeObject *)o)) { PyErr_SetString(PyExc_TypeError, "code object passed to exec() may not contain free variables"); goto bad; diff --git a/Cython/Utility/Exceptions.c b/Cython/Utility/Exceptions.c index 6378996b1..114366db5 100644 --- a/Cython/Utility/Exceptions.c +++ b/Cython/Utility/Exceptions.c @@ -615,7 +615,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; - py_frame->f_lineno = py_line; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index e2435855a..356e9ff4a 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -181,6 +181,9 @@ #define PyObject_Realloc(p) PyMem_Realloc(p) #endif +#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) +#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) + #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) |