diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-03-11 12:34:39 +0000 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-03-11 12:34:39 +0000 |
commit | 4a7e0c858c624eee49b9b1a977c887f5b49d0fd4 (patch) | |
tree | 7d40b555b47d3d472e6192803f8aaa051bae31cc /Modules/getpath.c | |
parent | 637637021a52d083f47dfdd6dd0cc16e31696409 (diff) | |
download | cpython-git-4a7e0c858c624eee49b9b1a977c887f5b49d0fd4.tar.gz |
Issue #7774: Set sys.executable to an empty string if argv[0] has been
set to an non existent program name and Python is unable to retrieve the real
program name.
Fix also sysconfig: if sys.executable is an empty string, use the current
working directory.
Diffstat (limited to 'Modules/getpath.c')
-rw-r--r-- | Modules/getpath.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c index 09fbe1017b..682ad3ed65 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -441,7 +441,7 @@ calculate_path(void) } else progpath[0] = '\0'; - if (progpath[0] != SEP) + if (progpath[0] != SEP && progpath[0] != '\0') absolutize(progpath); strncpy(argv0_path, progpath, MAXPATHLEN); argv0_path[MAXPATHLEN] = '\0'; |