summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/_warnings.c4
-rw-r--r--Python/ceval.c14
2 files changed, 8 insertions, 10 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 91c611c257..7a620dc543 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -784,10 +784,6 @@ is_internal_frame(PyFrameObject *frame)
}
PyCodeObject *code = PyFrame_GetCode(frame);
- if (code == NULL) {
- return 0;
- }
-
PyObject *filename = code->co_filename;
if (filename == NULL) {
return 0;
diff --git a/Python/ceval.c b/Python/ceval.c
index c610419f24..e15d7e0b46 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -5580,9 +5580,10 @@ dtrace_function_entry(PyFrameObject *f)
const char *funcname;
int lineno;
- filename = PyUnicode_AsUTF8(f->f_code->co_filename);
- funcname = PyUnicode_AsUTF8(f->f_code->co_name);
- lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
+ PyCodeObject *code = f->f_code;
+ filename = PyUnicode_AsUTF8(code->co_filename);
+ funcname = PyUnicode_AsUTF8(code->co_name);
+ lineno = PyCode_Addr2Line(code, f->f_lasti);
PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno);
}
@@ -5594,9 +5595,10 @@ dtrace_function_return(PyFrameObject *f)
const char *funcname;
int lineno;
- filename = PyUnicode_AsUTF8(f->f_code->co_filename);
- funcname = PyUnicode_AsUTF8(f->f_code->co_name);
- lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
+ PyCodeObject *code = f->f_code;
+ filename = PyUnicode_AsUTF8(code->co_filename);
+ funcname = PyUnicode_AsUTF8(code->co_name);
+ lineno = PyCode_Addr2Line(code, f->f_lasti);
PyDTrace_FUNCTION_RETURN(filename, funcname, lineno);
}