mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
gh-118527: Use _Py_ID(__main__)
for main module name (#118528)
Most module names are interned and immortalized, but the main module was not. This partially addresses a scaling bottleneck in the free-threaded when creating closure concurrently in the main module.
This commit is contained in:
parent
c8deb1e4b4
commit
24e643d4ef
1 changed files with 1 additions and 1 deletions
|
@ -2348,7 +2348,7 @@ static PyStatus
|
||||||
add_main_module(PyInterpreterState *interp)
|
add_main_module(PyInterpreterState *interp)
|
||||||
{
|
{
|
||||||
PyObject *m, *d, *ann_dict;
|
PyObject *m, *d, *ann_dict;
|
||||||
m = PyImport_AddModule("__main__");
|
m = PyImport_AddModuleObject(&_Py_ID(__main__));
|
||||||
if (m == NULL)
|
if (m == NULL)
|
||||||
return _PyStatus_ERR("can't create __main__ module");
|
return _PyStatus_ERR("can't create __main__ module");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue