From 281cce1106568ef9fec17e3c72d289416fac02a5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 23 Jun 2020 22:55:46 +0200 Subject: bpo-40521: Make MemoryError free list per interpreter (GH-21086) Each interpreter now has its own MemoryError free list: it is not longer shared by all interpreters. Add _Py_exc_state structure and PyInterpreterState.exc_state member. Move also errnomap into _Py_exc_state. --- Python/pylifecycle.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Python/pylifecycle.c') diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 09945a8f7a..f0b40b3aa6 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -602,7 +602,7 @@ pycore_init_types(PyThreadState *tstate) } } - status = _PyExc_Init(); + status = _PyExc_Init(tstate); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -1249,6 +1249,7 @@ flush_std_files(void) static void finalize_interp_types(PyThreadState *tstate, int is_main_interp) { + _PyExc_Fini(tstate); _PyFrame_Fini(tstate); _PyAsyncGen_Fini(tstate); _PyContext_Fini(tstate); @@ -1289,10 +1290,6 @@ finalize_interp_clear(PyThreadState *tstate) _PyWarnings_Fini(tstate->interp); - if (is_main_interp) { - _PyExc_Fini(); - } - finalize_interp_types(tstate, is_main_interp); } -- cgit v1.2.1