Skip to content

Commit 851deb9

Browse files
committed
Drop interp var and use tstate->interp in debug code
1 parent 62c99cd commit 851deb9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Python/pylifecycle.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,9 +1644,6 @@ Py_FinalizeEx(void)
16441644

16451645
/* Get current thread state and interpreter pointer */
16461646
PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
1647-
#if (defined(Py_REF_DEBUG) || defined(Py_TRACE_REFS) || defined(WITH_PYMALLOC))
1648-
PyInterpreterState *interp = tstate->interp;
1649-
#endif
16501647

16511648
// Wrap up existing "threading"-module-created, non-daemon threads.
16521649
wait_for_thread_shutdown(tstate);
@@ -1669,13 +1666,13 @@ Py_FinalizeEx(void)
16691666
/* Copy the core config, PyInterpreterState_Delete() free
16701667
the core config memory */
16711668
#ifdef Py_REF_DEBUG
1672-
int show_ref_count = interp->config.show_ref_count;
1669+
int show_ref_count = tstate->interp->config.show_ref_count;
16731670
#endif
16741671
#ifdef Py_TRACE_REFS
1675-
int dump_refs = interp->config.dump_refs;
1672+
int dump_refs = tstate->interp->config.dump_refs;
16761673
#endif
16771674
#ifdef WITH_PYMALLOC
1678-
int malloc_stats = interp->config.malloc_stats;
1675+
int malloc_stats = tstate->interp->config.malloc_stats;
16791676
#endif
16801677

16811678
/* Remaining daemon threads will automatically exit

0 commit comments

Comments
 (0)