]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107674: Remove some unnecessary code in instrumentation code (GH-117393)
authorTian Gao <gaogaotiantian@hotmail.com>
Tue, 9 Apr 2024 08:54:28 +0000 (01:54 -0700)
committerGitHub <noreply@github.com>
Tue, 9 Apr 2024 08:54:28 +0000 (09:54 +0100)
Python/instrumentation.c

index 0f60290865000cca9241a376121dd124b9c7ca69..3866144a19bf7475a186033f0a0fd135b7ceedcf 100644 (file)
@@ -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;