File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -187,16 +187,19 @@ struct _ts {
187187 /* The following fields are here to avoid allocation during init.
188188 The data is exposed through PyThreadState pointer fields.
189189 These fields should not be accessed directly outside of init.
190+ This is indicated by an underscore prefix on the field names.
190191
191192 All other PyInterpreterState pointer fields are populated when
192193 needed and default to NULL.
193194 */
195+ // Note some fields do not have a leading underscore for backward
196+ // compatibility. See https://bugs.python.org/issue45953#msg412046.
194197
195198 /* The thread's exception stack entry. (Always the last entry.) */
196- _PyErr_StackItem _exc_state ;
199+ _PyErr_StackItem exc_state ;
197200
198201 /* The bottom-most frame on the stack. */
199- CFrame _root_cframe ;
202+ CFrame root_cframe ;
200203};
201204
202205
Original file line number Diff line number Diff line change @@ -776,9 +776,9 @@ init_threadstate(PyThreadState *tstate,
776776 tstate -> recursion_limit = interp -> ceval .recursion_limit ,
777777 tstate -> recursion_remaining = interp -> ceval .recursion_limit ,
778778
779- tstate -> exc_info = & tstate -> _exc_state ;
779+ tstate -> exc_info = & tstate -> exc_state ;
780780
781- tstate -> cframe = & tstate -> _root_cframe ;
781+ tstate -> cframe = & tstate -> root_cframe ;
782782 tstate -> datastack_chunk = NULL ;
783783 tstate -> datastack_top = NULL ;
784784 tstate -> datastack_limit = NULL ;
@@ -1016,10 +1016,10 @@ PyThreadState_Clear(PyThreadState *tstate)
10161016 Py_CLEAR (tstate -> curexc_value );
10171017 Py_CLEAR (tstate -> curexc_traceback );
10181018
1019- Py_CLEAR (tstate -> _exc_state .exc_value );
1019+ Py_CLEAR (tstate -> exc_state .exc_value );
10201020
10211021 /* The stack of exception states should contain just this thread. */
1022- if (verbose && tstate -> exc_info != & tstate -> _exc_state ) {
1022+ if (verbose && tstate -> exc_info != & tstate -> exc_state ) {
10231023 fprintf (stderr ,
10241024 "PyThreadState_Clear: warning: thread still has a generator\n" );
10251025 }
You can’t perform that action at this time.
0 commit comments