PyInterpreterState *interp, PyObject *nsupdates,
_PyXI_session_result *result)
{
- PyThreadState *tstate = _PyThreadState_GET();
+#ifndef NDEBUG
+ PyThreadState *tstate = _PyThreadState_GET(); // Only used for asserts
+#endif
// Convert the attrs for cross-interpreter use.
_PyXI_namespace *sharedns = NULL;
_enter_session(session, interp);
_PyXI_failure override = XI_FAILURE_INIT;
override.code = _PyXI_ERR_UNCAUGHT_EXCEPTION;
+#ifndef NDEBUG
tstate = _PyThreadState_GET();
+#endif
// Ensure this thread owns __main__.
if (_PyInterpreterState_SetRunningMain(interp) < 0) {
// Exit the session.
_exit_session(session);
+#ifndef NDEBUG
tstate = _PyThreadState_GET();
+#endif
if (sharedns != NULL) {
_destroy_sharedns(sharedns);