Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
a35f4153
Commit
a35f4153
authored
Sep 01, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix line tracing test in Py2.6.
See #1774.
parent
3a8b41ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
tests/run/line_trace.pyx
tests/run/line_trace.pyx
+11
-8
No files found.
tests/run/line_trace.pyx
View file @
a35f4153
...
...
@@ -3,11 +3,11 @@
# mode: run
# tag: trace
from
cpython.ref
cimport
PyObject
,
Py_INCREF
,
Py_XINCREF
,
Py_XDECREF
cdef
extern
from
"frameobject.h"
:
ctypedef
struct
PyFrameObject
:
pass
from
cpython.ref
cimport
PyObject
PyObject
*
f_trace
from
cpython.pystate
cimport
(
Py_tracefunc
,
...
...
@@ -38,20 +38,23 @@ cdef int trace_trampoline(PyObject* _traceobj, PyFrameObject* _frame, int what,
if
what
==
PyTrace_CALL
:
callback
=
traceobj
else
:
callback
=
frame
.
f_trace
callback
=
<
object
>
_
frame
.
f_trace
if
callback
is
None
:
return
0
result
=
callback
(
frame
,
what
,
arg
)
frame
.
f_trace
=
result
# A bug in Py2.6 prevents us from calling the Python-level setter here,
# or otherwise we would get miscalculated line numbers. Was fixed in Py2.7.
cdef
PyObject
*
tmp
=
_frame
.
f_trace
Py_INCREF
(
result
)
_frame
.
f_trace
=
<
PyObject
*>
result
Py_XDECREF
(
tmp
)
if
result
is
None
:
PyEval_SetTrace
(
NULL
,
None
)
return
0
else
:
return
0
return
0
def
_create_trace_func
(
trace
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment