Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eca4784

Browse files
committed
Mark Hammond: For Windows debug builds, we now only offer to dump
remaining object references if the environment variable PYTHONDUMPREFS exists. The default behaviour caused problems for background or otherwise invisible processes that use the debug build of Python.
1 parent 7c4f96f commit eca4784

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Python/pythonrun.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ Py_Finalize()
242242
#endif
243243

244244
#ifdef Py_TRACE_REFS
245-
if (_Py_AskYesNo("Print left references?")) {
245+
if (
246+
#ifdef MS_WINDOWS /* Only ask on Windows if env var set */
247+
getenv("PYTHONDUMPREFS") &&
248+
#endif /* MS_WINDOWS */
249+
_Py_AskYesNo("Print left references?")) {
246250
_Py_PrintReferences(stderr);
247251
}
248252
#endif /* Py_TRACE_REFS */

0 commit comments

Comments
 (0)