summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c
index a062991..f6e7889 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -508,10 +508,14 @@ pymain_free(_PyMain *pymain)
static int
pymain_sys_path_add_path0(PyInterpreterState *interp, PyObject *path0)
{
+ _Py_IDENTIFIER(path);
PyObject *sys_path;
PyObject *sysdict = interp->sysdict;
if (sysdict != NULL) {
- sys_path = PyDict_GetItemString(sysdict, "path");
+ sys_path = _PyDict_GetItemIdWithError(sysdict, &PyId_path);
+ if (sys_path == NULL && PyErr_Occurred()) {
+ goto error;
+ }
}
else {
sys_path = NULL;