diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2019-05-10 13:29:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 13:29:55 -0400 |
commit | 86ea58149c3e83f402cecd17e6a536865fb06ce1 (patch) | |
tree | a7a26190fcb98d298cc992da4ad9d8f663304bdb /Python/pystate.c | |
parent | 351c67416ba4451eb3928fa0b2e933c2f25df1a3 (diff) | |
download | cpython-git-86ea58149c3e83f402cecd17e6a536865fb06ce1.tar.gz |
bpo-36737: Use the module state C-API for warnings. (gh-13159)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index e9c4c7d837..44acfed6b9 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -5,6 +5,7 @@ #include "pycore_coreconfig.h" #include "pycore_pymem.h" #include "pycore_pystate.h" +#include "pycore_pylifecycle.h" /* -------------------------------------------------------------------------- CAUTION @@ -257,6 +258,9 @@ _PyInterpreterState_Clear(_PyRuntimeState *runtime, PyInterpreterState *interp) Py_CLEAR(interp->after_forkers_parent); Py_CLEAR(interp->after_forkers_child); #endif + if (runtime->finalizing == NULL) { + _PyWarnings_Fini(interp); + } // XXX Once we have one allocator per interpreter (i.e. // per-interpreter GC) we must ensure that all of the interpreter's // objects have been cleaned up at the point. |