diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_lsprof.c | 9 | ||||
-rw-r--r-- | Modules/_tracemalloc.c | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 7115fee1f2..39cf6e126d 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -1,5 +1,4 @@ #include "Python.h" -#include "frameobject.h" #include "rotatingtree.h" /************************************************************/ @@ -388,14 +387,16 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what, /* the 'frame' of a called function is about to start its execution */ case PyTrace_CALL: - ptrace_enter_call(self, (void *)frame->f_code, - (PyObject *)frame->f_code); + { + PyCodeObject *code = PyFrame_GetCode(frame); + ptrace_enter_call(self, (void *)code, (PyObject *)code); break; + } /* the 'frame' of a called function is about to finish (either normally or with an exception) */ case PyTrace_RETURN: - ptrace_leave_call(self, (void *)frame->f_code); + ptrace_leave_call(self, (void *)PyFrame_GetCode(frame)); break; /* case PyTrace_EXCEPTION: diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index dbae107c2d..3593baee51 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -346,7 +346,7 @@ tracemalloc_get_frame(PyFrameObject *pyframe, frame_t *frame) lineno = 0; frame->lineno = (unsigned int)lineno; - code = pyframe->f_code; + code = PyFrame_GetCode(pyframe); if (code == NULL) { #ifdef TRACE_DEBUG tracemalloc_error("failed to get the code object of the frame"); |