diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-11-03 11:52:58 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-11-03 11:52:58 (GMT) |
commit | 69032c81aaad1eaff7b58d5cbf9e51537e135c55 (patch) | |
tree | 6c829cd61d4068265f8f0cecf75753242009d374 /Modules/getpath.c | |
parent | 683b46aa8df73c41ccafdfe5909a466c1616cc20 (diff) | |
download | cpython-69032c81aaad1eaff7b58d5cbf9e51537e135c55.zip cpython-69032c81aaad1eaff7b58d5cbf9e51537e135c55.tar.gz cpython-69032c81aaad1eaff7b58d5cbf9e51537e135c55.tar.bz2 |
Issue #16309: Make PYTHONPATH= behavior the same as if PYTHONPATH not set at all.
Thanks to Armin Rigo and Alexey Kachayev.
Diffstat (limited to 'Modules/getpath.c')
-rw-r--r-- | Modules/getpath.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c index b98c520..be164df 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -699,13 +699,11 @@ calculate_path(void) */ bufsz = 0; - if (_rtpypath) { + if (_rtpypath && _rtpypath[0] != '\0') { size_t rtpypath_len; rtpypath = _Py_char2wchar(_rtpypath, &rtpypath_len); if (rtpypath != NULL) bufsz += rtpypath_len + 1; - else - _rtpypath = NULL; } defpath = _pythonpath; |