Skip to content

Commit

Permalink
Remove unnecessary logging during interpreter shutdown. Fixes #426.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Sep 13, 2024
1 parent 8cb3791 commit 6105b1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- Fix crashes on 32-bit PPC Linux.
See `issue 422
<https://github.com/python-greenlet/greenlet/issues/422>`_.
- Remove unnecessary logging sometimes during interpreter shutdown.
See `issue 426 <https://github.com/python-greenlet/greenlet/issues/426>`_.

3.1.0 (2024-09-10)
==================
Expand Down
4 changes: 4 additions & 0 deletions src/greenlet/TThreadStateDestroy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6105b1a

Please sign in to comment.