summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-11 10:07:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-11 10:07:48 (GMT)
commitac40c6c575d2f6e619b998b7b91437f6a93bcde2 (patch)
treea27184039aab4a2c3553aeb2a6312b478230d0db /Modules
parent684cadaef94241a8552581d332cf2008ad426d18 (diff)
parenta27c064428c9e3b601be69876ef7e7299a3e0b7f (diff)
downloadcpython-ac40c6c575d2f6e619b998b7b91437f6a93bcde2.zip
cpython-ac40c6c575d2f6e619b998b7b91437f6a93bcde2.tar.gz
cpython-ac40c6c575d2f6e619b998b7b91437f6a93bcde2.tar.bz2
Issue #19398: Extra slash no longer added to sys.path components in case of
empty compile-time PYTHONPATH components. This fixes some tests in -S or -I modes.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getpath.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 65b47a3..0f91643 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -762,7 +762,10 @@ calculate_path(void)
if (defpath[0] != SEP) {
wcscat(buf, prefix);
- wcscat(buf, separator);
+ if (prefixsz >= 2 && prefix[prefixsz - 2] != SEP &&
+ defpath[0] != (delim ? DELIM : L'\0')) { /* not empty */
+ wcscat(buf, separator);
+ }
}
if (delim) {