Skip to content

Commit bfd0258

Browse files
committed
gh-135513: Fix unused variable warning in crossinterp.c
1 parent 028309f commit bfd0258

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Python/crossinterp.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2619,7 +2619,9 @@ _PyXI_Enter(_PyXI_session *session,
26192619
PyInterpreterState *interp, PyObject *nsupdates,
26202620
_PyXI_session_result *result)
26212621
{
2622-
PyThreadState *tstate = _PyThreadState_GET();
2622+
#ifndef NDEBUG
2623+
PyThreadState *tstate = _PyThreadState_GET(); // Only used for asserts
2624+
#endif
26232625

26242626
// Convert the attrs for cross-interpreter use.
26252627
_PyXI_namespace *sharedns = NULL;
@@ -2661,7 +2663,9 @@ _PyXI_Enter(_PyXI_session *session,
26612663
_enter_session(session, interp);
26622664
_PyXI_failure override = XI_FAILURE_INIT;
26632665
override.code = _PyXI_ERR_UNCAUGHT_EXCEPTION;
2666+
#ifndef NDEBUG
26642667
tstate = _PyThreadState_GET();
2668+
#endif
26652669

26662670
// Ensure this thread owns __main__.
26672671
if (_PyInterpreterState_SetRunningMain(interp) < 0) {

0 commit comments

Comments
 (0)