gh-151524: Make it clearer that `_PyInstrumentation_DISABLE` is immortal in the code (GH-151525)
ZeroIntensity <[email protected]> Fri, 07 Aug 2026 11:34:24 -0400 (EDT)
| Newsgroups | gmane.comp.python.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://github.com/python/cpython/commit/52bed26b79cc0333f1b26fd144488e4b38ebd0b5 commit: 52bed26b79cc0333f1b26fd144488e4b38ebd0b5 branch: main author: stevens <[email protected]> committer: ZeroIntensity <[email protected]> date: 2026-08-07T11:34:10-04:00 summary: gh-151524: Make it clearer that `_PyInstrumentation_DISABLE` is immortal in the code (GH-151525) files: M Python/instrumentation.c diff --git a/Python/instrumentation.c b/Python/instrumentation.c index 0af2070b5cd983..806d3fbf5d6b19 100644 --- a/Python/instrumentation.c +++ b/Python/instrumentation.c @@ -989,8 +989,12 @@ call_one_instrument( if (res == NULL) { return -1; } + if (res == &_PyInstrumentation_DISABLE) { + assert(_Py_IsImmortal(res)); + return 1; + } Py_DECREF(res); - return (res == &_PyInstrumentation_DISABLE); + return 0; } static const int8_t MOST_SIGNIFICANT_BITS[16] = { _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]