@@ -65,7 +65,7 @@ extern grammar _PyParser_Grammar; /* From graminit.c */
65
65
/* Forward declarations */
66
66
static PyStatus add_main_module (PyInterpreterState * interp );
67
67
static PyStatus init_import_site (void );
68
- static PyStatus init_set_builtins_open (PyThreadState * tstate );
68
+ static PyStatus init_set_builtins_open (void );
69
69
static PyStatus init_sys_streams (PyThreadState * tstate );
70
70
static PyStatus init_signals (PyThreadState * tstate );
71
71
static void call_py_exitfuncs (PyThreadState * tstate );
@@ -1025,7 +1025,7 @@ init_interp_main(PyThreadState *tstate)
1025
1025
return status ;
1026
1026
}
1027
1027
1028
- status = init_set_builtins_open (tstate );
1028
+ status = init_set_builtins_open ();
1029
1029
if (_PyStatus_EXCEPTION (status )) {
1030
1030
return status ;
1031
1031
}
@@ -1888,7 +1888,7 @@ create_stdio(const PyConfig *config, PyObject* io,
1888
1888
1889
1889
/* Set builtins.open to io.OpenWrapper */
1890
1890
static PyStatus
1891
- init_set_builtins_open (PyThreadState * tstate )
1891
+ init_set_builtins_open (void )
1892
1892
{
1893
1893
PyObject * iomod = NULL , * wrapper ;
1894
1894
PyObject * bimod = NULL ;
@@ -2056,9 +2056,8 @@ _Py_FatalError_DumpTracebacks(int fd, PyInterpreterState *interp,
2056
2056
Return 1 if the traceback was displayed, 0 otherwise. */
2057
2057
2058
2058
static int
2059
- _Py_FatalError_PrintExc (int fd )
2059
+ _Py_FatalError_PrintExc (PyThreadState * tstate )
2060
2060
{
2061
- PyThreadState * tstate = _PyThreadState_GET ();
2062
2061
PyObject * ferr , * res ;
2063
2062
PyObject * exception , * v , * tb ;
2064
2063
int has_tb ;
@@ -2220,7 +2219,7 @@ fatal_error(const char *prefix, const char *msg, int status)
2220
2219
int has_tstate_and_gil = (tss_tstate != NULL && tss_tstate == tstate );
2221
2220
if (has_tstate_and_gil ) {
2222
2221
/* If an exception is set, print the exception with its traceback */
2223
- if (!_Py_FatalError_PrintExc (fd )) {
2222
+ if (!_Py_FatalError_PrintExc (tss_tstate )) {
2224
2223
/* No exception is set, or an exception is set without traceback */
2225
2224
_Py_FatalError_DumpTracebacks (fd , interp , tss_tstate );
2226
2225
}
0 commit comments