diff options
| author | Victor Stinner <vstinner@python.org> | 2023-06-22 22:04:39 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-22 22:04:39 (GMT) |
| commit | 193a2b2eaab9890f2cb16128c95bb63cb49307f1 (patch) | |
| tree | 5adc9c1888c7338746c57c7b9ab329e8cf269795 /Python/pythonrun.c | |
| parent | 403a574b000569ea2c91f5325e6a8061a29e64bf (diff) | |
| download | cpython-193a2b2eaab9890f2cb16128c95bb63cb49307f1.zip cpython-193a2b2eaab9890f2cb16128c95bb63cb49307f1.tar.gz cpython-193a2b2eaab9890f2cb16128c95bb63cb49307f1.tar.bz2 | |
gh-105922: Use PyImport_AddModuleRef() function (#105999)
Replace PyImport_AddModuleObject() + Py_XNewRef() with
PyImport_AddModuleRef() to get directly a strong reference.
Diffstat (limited to 'Python/pythonrun.c')
| -rw-r--r-- | Python/pythonrun.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index af82fa4..2986622 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -276,7 +276,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, return parse_res; } - PyObject *main_module = Py_XNewRef(PyImport_AddModuleObject(&_Py_ID(__main__))); + PyObject *main_module = PyImport_AddModuleRef("__main__"); if (main_module == NULL) { _PyArena_Free(arena); return -1; |
