Commit 920ab180 authored by Stefan Behnel's avatar Stefan Behnel

fix tracing in recent Py3.4

parent c7eebbaa
...@@ -112,14 +112,13 @@ static int __Pyx_TraceSetupAndCall(PyCodeObject** code, ...@@ -112,14 +112,13 @@ static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
const char *srcfile, const char *srcfile,
int firstlineno) { int firstlineno) {
int retval; int retval;
PyThreadState* tstate = PyThreadState_GET();
if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
if (*code == NULL) { if (*code == NULL) {
*code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
if (*code == NULL) return 0; if (*code == NULL) return 0;
} }
*frame = PyFrame_New( *frame = PyFrame_New(
tstate, /*PyThreadState *tstate*/ PyThreadState_GET(), /*PyThreadState *tstate*/
*code, /*PyCodeObject *code*/ *code, /*PyCodeObject *code*/
$moddict_cname, /*PyObject *globals*/ $moddict_cname, /*PyObject *globals*/
0 /*PyObject *locals*/ 0 /*PyObject *locals*/
...@@ -130,8 +129,10 @@ static int __Pyx_TraceSetupAndCall(PyCodeObject** code, ...@@ -130,8 +129,10 @@ static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
Py_INCREF(Py_None); Py_INCREF(Py_None);
(*frame)->f_trace = Py_None; (*frame)->f_trace = Py_None;
} }
#if PY_VERSION_HEX < 0x030400B1
} else { } else {
(*frame)->f_tstate = tstate; (*frame)->f_tstate = PyThreadState_GET();
#endif
} }
(*frame)->f_lineno = firstlineno; (*frame)->f_lineno = firstlineno;
tstate->use_tracing = 0; tstate->use_tracing = 0;
......
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