diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2024-09-27 12:49:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 12:49:43 (GMT) |
commit | 365dffbaada421db8fdb684a84d1fb311b75ec40 (patch) | |
tree | 1c79d651d4b91e36f614e20f4f63a1ac089148b7 /Python | |
parent | b79a21ea429844e84509430e636d808ea9cff244 (diff) | |
download | cpython-365dffbaada421db8fdb684a84d1fb311b75ec40.zip cpython-365dffbaada421db8fdb684a84d1fb311b75ec40.tar.gz cpython-365dffbaada421db8fdb684a84d1fb311b75ec40.tar.bz2 |
gh-119180: No longer set `__annotations__` in `__main__` (#124634)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pylifecycle.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 27faf72..8aebbe5 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2503,18 +2503,12 @@ finalize_subinterpreters(void) static PyStatus add_main_module(PyInterpreterState *interp) { - PyObject *m, *d, *ann_dict; + PyObject *m, *d; m = PyImport_AddModuleObject(&_Py_ID(__main__)); if (m == NULL) return _PyStatus_ERR("can't create __main__ module"); d = PyModule_GetDict(m); - ann_dict = PyDict_New(); - if ((ann_dict == NULL) || - (PyDict_SetItemString(d, "__annotations__", ann_dict) < 0)) { - return _PyStatus_ERR("Failed to initialize __main__.__annotations__"); - } - Py_DECREF(ann_dict); int has_builtins = PyDict_ContainsString(d, "__builtins__"); if (has_builtins < 0) { |