mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Set PYTHONHOME before loading Python, so that sys.path will be set correctly.
Already backported.
This commit is contained in:
parent
e4772f3ada
commit
8abe7bfb2f
1 changed files with 7 additions and 1 deletions
|
|
@ -613,7 +613,13 @@ static HINSTANCE LoadPythonDll(char *fname)
|
|||
char fullpath[_MAX_PATH];
|
||||
LONG size = sizeof(fullpath);
|
||||
char subkey_name[80];
|
||||
HINSTANCE h = LoadLibrary(fname);
|
||||
char buffer[260 + 12];
|
||||
HINSTANCE h;
|
||||
|
||||
/* make sure PYTHONHOME is set, to that sys.path is initialized correctly */
|
||||
wsprintf(buffer, "PYTHONHOME=%s", python_dir);
|
||||
_putenv(buffer);
|
||||
h = LoadLibrary(fname);
|
||||
if (h)
|
||||
return h;
|
||||
wsprintf(subkey_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue