Issue #16309: Make PYTHONPATH= behavior the same as if PYTHONPATH not set at all.

Thanks to Armin Rigo and Alexey Kachayev.
This commit is contained in:
Andrew Svetlov 2012-11-03 13:52:58 +02:00
parent 683b46aa8d
commit 69032c81aa
4 changed files with 22 additions and 3 deletions

View file

@ -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;