Issue #19512: add some common identifiers to only create common strings once,

instead of creating temporary Unicode string objects

Add also more identifiers in pythonrun.c to avoid temporary Unicode string
objets for the interactive interpreter.
This commit is contained in:
Victor Stinner 2013-11-06 22:41:44 +01:00
parent bb52020d44
commit 090543736f
13 changed files with 72 additions and 49 deletions

View file

@ -261,7 +261,7 @@ RunMainFromImporter(wchar_t *filename)
/* argv0 is usable as an import source, so put it in sys.path[0]
and import __main__ */
sys_path = PySys_GetObject("path");
sys_path = _PySys_GetObjectId(&_PyId_path);
if (sys_path == NULL) {
PyErr_SetString(PyExc_RuntimeError, "unable to get sys.path");
goto error;