Skip to content

Commit

Permalink
pythongh-120857: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
blhsing committed Jun 25, 2024
1 parent 4787900 commit 3692f7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3946,8 +3946,9 @@ type_new_set_module(PyTypeObject *type)
return 0;
}

PyObject *globals = PyEval_GetGlobals();
PyObject *module;
if (PyEval_GetGlobals() != NULL &&
if (globals != NULL &&
PyDict_GetItemRef(globals, &_Py_ID(__name__), &module) == 1 && module) {
r = PyDict_SetItem(dict, &_Py_ID(__module__), module);
Py_DECREF(module);
Expand Down

0 comments on commit 3692f7d

Please sign in to comment.