File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -254,16 +254,13 @@ inline void finalize_interpreter() {
254254 if (builtins.contains (id) && isinstance<capsule>(builtins[id])) {
255255 internals_ptr_ptr = capsule (builtins[id]);
256256 }
257-
258- Py_Finalize ();
259-
260257 // Local internals contains data managed by the current interpreter, so we must clear them to
261258 // avoid undefined behaviors when initializing another interpreter
262- // Must be cleared only after Py_Finalize() so atexit and other hooks can still use
263- // registered_types
264259 detail::get_local_internals ().registered_types_cpp .clear ();
265260 detail::get_local_internals ().registered_exception_translators .clear ();
266261
262+ Py_Finalize ();
263+
267264 if (internals_ptr_ptr) {
268265 delete *internals_ptr_ptr;
269266 *internals_ptr_ptr = nullptr ;
You can’t perform that action at this time.
0 commit comments