27
27
#include "pycore_ceval.h" // _PyEval_ReInitThreads()
28
28
#include "pycore_import.h" // _PyImport_ReInitLock()
29
29
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
30
- #include "pycore_pystate.h" // _PyInterpreterState_GET ()
30
+ #include "pycore_pystate.h" // PyInterpreterState_Get ()
31
31
32
32
#include "structmember.h" // PyMemberDef
33
33
#ifndef MS_WINDOWS
@@ -575,7 +575,7 @@ run_at_forkers(PyObject *lst, int reverse)
575
575
void
576
576
PyOS_BeforeFork (void )
577
577
{
578
- run_at_forkers (_PyInterpreterState_GET ()-> before_forkers , 1 );
578
+ run_at_forkers (PyInterpreterState_Get ()-> before_forkers , 1 );
579
579
580
580
_PyImport_AcquireLock ();
581
581
}
@@ -586,7 +586,7 @@ PyOS_AfterFork_Parent(void)
586
586
if (_PyImport_ReleaseLock () <= 0 )
587
587
Py_FatalError ("failed releasing import lock after fork" );
588
588
589
- run_at_forkers (_PyInterpreterState_GET ()-> after_forkers_parent , 0 );
589
+ run_at_forkers (PyInterpreterState_Get ()-> after_forkers_parent , 0 );
590
590
}
591
591
592
592
void
@@ -6650,7 +6650,7 @@ os_register_at_fork_impl(PyObject *module, PyObject *before,
6650
6650
check_null_or_callable (after_in_parent , "after_in_parent" )) {
6651
6651
return NULL ;
6652
6652
}
6653
- interp = _PyInterpreterState_GET ();
6653
+ interp = PyInterpreterState_Get ();
6654
6654
6655
6655
if (register_at_forker (& interp -> before_forkers , before )) {
6656
6656
return NULL ;
@@ -6680,8 +6680,8 @@ os_fork1_impl(PyObject *module)
6680
6680
/*[clinic end generated code: output=0de8e67ce2a310bc input=12db02167893926e]*/
6681
6681
{
6682
6682
pid_t pid ;
6683
-
6684
- if (_PyInterpreterState_GET () != PyInterpreterState_Main ( )) {
6683
+ PyInterpreterState * interp = PyInterpreterState_Get ();
6684
+ if (_Py_IsMainInterpreter ( interp )) {
6685
6685
PyErr_SetString (PyExc_RuntimeError , "fork not supported for subinterpreters" );
6686
6686
return NULL ;
6687
6687
}
@@ -6715,7 +6715,7 @@ os_fork_impl(PyObject *module)
6715
6715
/*[clinic end generated code: output=3626c81f98985d49 input=13c956413110eeaa]*/
6716
6716
{
6717
6717
pid_t pid ;
6718
- PyInterpreterState * interp = _PyInterpreterState_GET ();
6718
+ PyInterpreterState * interp = PyInterpreterState_Get ();
6719
6719
if (interp -> config ._isolated_interpreter ) {
6720
6720
PyErr_SetString (PyExc_RuntimeError ,
6721
6721
"fork not supported for isolated subinterpreters" );
@@ -7333,7 +7333,7 @@ os_forkpty_impl(PyObject *module)
7333
7333
int master_fd = -1 ;
7334
7334
pid_t pid ;
7335
7335
7336
- if (_PyInterpreterState_GET () != PyInterpreterState_Main ()) {
7336
+ if (PyInterpreterState_Get () != PyInterpreterState_Main ()) {
7337
7337
PyErr_SetString (PyExc_RuntimeError , "fork not supported for subinterpreters" );
7338
7338
return NULL ;
7339
7339
}
0 commit comments