Skip to content

Commit

Permalink
Set PYTHONHOME before loading Python, so that sys.path will be set co…
Browse files Browse the repository at this point in the history
…rrectly.

Already backported.
  • Loading branch information
Thomas Heller committed Feb 3, 2005
1 parent e4772f3 commit 8abe7bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PC/bdist_wininst/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8abe7bf

Please sign in to comment.