summaryrefslogtreecommitdiff
path: root/Modules/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 0343ddab6e..e592d8bd2f 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -260,8 +260,10 @@ 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");
- if (sys_path == NULL)
+ if (sys_path == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "unable to get sys.path");
goto error;
+ }
if (PyList_SetItem(sys_path, 0, argv0)) {
argv0 = NULL;
goto error;