File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2619,7 +2619,9 @@ _PyXI_Enter(_PyXI_session *session,
2619
2619
PyInterpreterState * interp , PyObject * nsupdates ,
2620
2620
_PyXI_session_result * result )
2621
2621
{
2622
- PyThreadState * tstate = _PyThreadState_GET ();
2622
+ #ifndef NDEBUG
2623
+ PyThreadState * tstate = _PyThreadState_GET (); // Only used for asserts
2624
+ #endif
2623
2625
2624
2626
// Convert the attrs for cross-interpreter use.
2625
2627
_PyXI_namespace * sharedns = NULL ;
@@ -2661,7 +2663,9 @@ _PyXI_Enter(_PyXI_session *session,
2661
2663
_enter_session (session , interp );
2662
2664
_PyXI_failure override = XI_FAILURE_INIT ;
2663
2665
override .code = _PyXI_ERR_UNCAUGHT_EXCEPTION ;
2666
+ #ifndef NDEBUG
2664
2667
tstate = _PyThreadState_GET ();
2668
+ #endif
2665
2669
2666
2670
// Ensure this thread owns __main__.
2667
2671
if (_PyInterpreterState_SetRunningMain (interp ) < 0 ) {
@@ -2697,7 +2701,9 @@ _PyXI_Enter(_PyXI_session *session,
2697
2701
2698
2702
// Exit the session.
2699
2703
_exit_session (session );
2704
+ #ifndef NDEBUG
2700
2705
tstate = _PyThreadState_GET ();
2706
+ #endif
2701
2707
2702
2708
if (sharedns != NULL ) {
2703
2709
_destroy_sharedns (sharedns );
You can’t perform that action at this time.
0 commit comments