* Fixes #7731

* logic error
This commit is contained in:
Greg Landrum
2024-09-19 18:42:42 +02:00
committed by GitHub
parent bb066c43f4
commit 165525b3ba

View File

@@ -78,7 +78,11 @@ struct PyLogStream : std::ostream, std::streambuf {
}
~PyLogStream() {
#if PY_VERSION_HEX < 0x30d0000
if (!_Py_IsFinalizing()) {
#else
if (!Py_IsFinalizing()) {
#endif
Py_XDECREF(logfn);
}
}