Mailing List Archive

gh-107674: Remove some unnecessary code in instrumentation code (GH-117393)
https://github.com/python/cpython/commit/57183241af76bf33e44d886a733f799d20fc680c
commit: 57183241af76bf33e44d886a733f799d20fc680c
branch: main
author: Tian Gao <gaogaotiantian@hotmail.com>
committer: markshannon <mark@hotpy.org>
date: 2024-04-09T09:54:28+01:00
summary:

gh-107674: Remove some unnecessary code in instrumentation code (GH-117393)

files:
M Python/instrumentation.c

diff --git a/Python/instrumentation.c b/Python/instrumentation.c
index 0f60290865000c..3866144a19bf74 100644
--- a/Python/instrumentation.c
+++ b/Python/instrumentation.c
@@ -1197,7 +1197,7 @@ _Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame,
/* Special case sys.settrace to avoid boxing the line number,
* only to immediately unbox it. */
if (tools & (1 << PY_MONITORING_SYS_TRACE_ID)) {
- if (tstate->c_tracefunc != NULL && line >= 0) {
+ if (tstate->c_tracefunc != NULL) {
PyFrameObject *frame_obj = _PyFrame_GetFrameObject(frame);
if (frame_obj == NULL) {
return -1;

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com