File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ static PyObject *empty_tuple = NULL;
136136/* For looking up name pairs in copyreg._extension_registry. */
137137static PyObject * two_tuple = NULL ;
138138
139+ _Py_IDENTIFIER (modules );
140+
139141static int
140142stack_underflow (void )
141143{
@@ -1363,7 +1365,7 @@ whichmodule(PyObject *global, PyObject *global_name)
13631365 return NULL ;
13641366
13651367 search :
1366- modules_dict = PySys_GetObject ( "modules" );
1368+ modules_dict = _PySys_GetObjectId ( & PyId_modules );
13671369 if (modules_dict == NULL ) {
13681370 PyErr_SetString (PyExc_RuntimeError , "unable to get sys.modules" );
13691371 return NULL ;
@@ -5548,7 +5550,7 @@ Unpickler_find_class(UnpicklerObject *self, PyObject *args)
55485550 }
55495551 }
55505552
5551- modules_dict = PySys_GetObject ( "modules" );
5553+ modules_dict = _PySys_GetObjectId ( & PyId_modules );
55525554 if (modules_dict == NULL ) {
55535555 PyErr_SetString (PyExc_RuntimeError , "unable to get sys.modules" );
55545556 return NULL ;
You can’t perform that action at this time.
0 commit comments