diff --git a/CHANGES.rst b/CHANGES.rst index 9993975..99c45c6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,8 @@ - Fix crashes on 32-bit PPC Linux. See `issue 422 `_. +- Remove unnecessary logging sometimes during interpreter shutdown. + See `issue 426 `_. 3.1.0 (2024-09-10) ================== diff --git a/src/greenlet/TThreadStateDestroy.cpp b/src/greenlet/TThreadStateDestroy.cpp index 3aab2e7..e5a9661 100644 --- a/src/greenlet/TThreadStateDestroy.cpp +++ b/src/greenlet/TThreadStateDestroy.cpp @@ -108,9 +108,13 @@ struct ThreadState_DestroyNoGIL #else if (_Py_IsFinalizing()) { #endif +#ifdef GREENLET_DEBUG + // No need to log in the general case. Yes, we'll leak, + // but we're shutting down so it should be ok. fprintf(stderr, "greenlet: WARNING: Interpreter is finalizing. Ignoring " "call to Py_AddPendingCall; \n"); +#endif return 0; } return Py_AddPendingCall(func, arg);