mirror of
https://github.com/python/cpython.git
synced 2025-12-10 02:50:09 +00:00
Patch #1232023: Don't include empty path component from registry,
so that the current directory does not get added to sys.path. Also fixes #1526785.
This commit is contained in:
parent
bda0dde1c4
commit
d22968af17
2 changed files with 7 additions and 0 deletions
|
|
@ -297,6 +297,10 @@ getpythonregpath(HKEY keyBase, int skipcore)
|
|||
}
|
||||
RegCloseKey(subKey);
|
||||
}
|
||||
|
||||
/* return null if no path to return */
|
||||
if (dataSize == 0) goto done;
|
||||
|
||||
/* original datasize from RegQueryInfo doesn't include the \0 */
|
||||
dataBuf = malloc((dataSize+1) * sizeof(TCHAR));
|
||||
if (dataBuf) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue