mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-40429: PyFrame_GetCode() result cannot be NULL (GH-19772)
Add frame_nslots() to factorize duplicate code.
This commit is contained in:
parent
521c8d6806
commit
6d86a2331e
7 changed files with 45 additions and 48 deletions
|
|
@ -347,13 +347,6 @@ tracemalloc_get_frame(PyFrameObject *pyframe, frame_t *frame)
|
|||
frame->lineno = (unsigned int)lineno;
|
||||
|
||||
code = PyFrame_GetCode(pyframe);
|
||||
if (code == NULL) {
|
||||
#ifdef TRACE_DEBUG
|
||||
tracemalloc_error("failed to get the code object of the frame");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if (code->co_filename == NULL) {
|
||||
#ifdef TRACE_DEBUG
|
||||
tracemalloc_error("failed to get the filename of the code object");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue