Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf45a8e

Browse files
committed
I don't need __globals__ and it causes a lot of failures
1 parent bd49622 commit bf45a8e

6 files changed

Lines changed: 0 additions & 14 deletions

File tree

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ struct _Py_global_strings {
124124
STRUCT_FOR_ID(__getnewargs__)
125125
STRUCT_FOR_ID(__getnewargs_ex__)
126126
STRUCT_FOR_ID(__getstate__)
127-
STRUCT_FOR_ID(__globals__)
128127
STRUCT_FOR_ID(__gt__)
129128
STRUCT_FOR_ID(__hash__)
130129
STRUCT_FOR_ID(__iadd__)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/typeobject.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,9 +3040,6 @@ type_new_set_module(PyTypeObject *type)
30403040
if (PyDict_SetItem(type->tp_dict, &_Py_ID(__module__), module) < 0) {
30413041
return -1;
30423042
}
3043-
if (PyDict_SetItem(type->tp_dict, &_Py_ID(__globals__), globals) < 0) {
3044-
return -1;
3045-
}
30463043
return 0;
30473044
}
30483045

Python/bltinmodule.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs,
195195
Py_TYPE(ns)->tp_name);
196196
goto error;
197197
}
198-
PyObject *globals = PyEval_GetGlobals();
199-
if ((globals == NULL)
200-
|| (PyMapping_SetItemString(ns, "__globals__", globals) < 0)) {
201-
goto error;
202-
}
203198
PyThreadState *tstate = _PyThreadState_GET();
204199
EVAL_CALL_STAT_INC(EVAL_CALL_BUILD_CLASS);
205200
cell = _PyEval_Vector(tstate, (PyFunctionObject *)func, ns, NULL, 0, NULL);

0 commit comments

Comments
 (0)