mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-135513: Fix unused variable warning in crossinterp.c
(#135514)
This commit is contained in:
parent
f079979599
commit
4c15505071
1 changed files with 7 additions and 1 deletions
|
@ -2619,7 +2619,9 @@ _PyXI_Enter(_PyXI_session *session,
|
||||||
PyInterpreterState *interp, PyObject *nsupdates,
|
PyInterpreterState *interp, PyObject *nsupdates,
|
||||||
_PyXI_session_result *result)
|
_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.
|
// Convert the attrs for cross-interpreter use.
|
||||||
_PyXI_namespace *sharedns = NULL;
|
_PyXI_namespace *sharedns = NULL;
|
||||||
|
@ -2661,7 +2663,9 @@ _PyXI_Enter(_PyXI_session *session,
|
||||||
_enter_session(session, interp);
|
_enter_session(session, interp);
|
||||||
_PyXI_failure override = XI_FAILURE_INIT;
|
_PyXI_failure override = XI_FAILURE_INIT;
|
||||||
override.code = _PyXI_ERR_UNCAUGHT_EXCEPTION;
|
override.code = _PyXI_ERR_UNCAUGHT_EXCEPTION;
|
||||||
|
#ifndef NDEBUG
|
||||||
tstate = _PyThreadState_GET();
|
tstate = _PyThreadState_GET();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Ensure this thread owns __main__.
|
// Ensure this thread owns __main__.
|
||||||
if (_PyInterpreterState_SetRunningMain(interp) < 0) {
|
if (_PyInterpreterState_SetRunningMain(interp) < 0) {
|
||||||
|
@ -2697,7 +2701,9 @@ error:
|
||||||
|
|
||||||
// Exit the session.
|
// Exit the session.
|
||||||
_exit_session(session);
|
_exit_session(session);
|
||||||
|
#ifndef NDEBUG
|
||||||
tstate = _PyThreadState_GET();
|
tstate = _PyThreadState_GET();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sharedns != NULL) {
|
if (sharedns != NULL) {
|
||||||
_destroy_sharedns(sharedns);
|
_destroy_sharedns(sharedns);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue