summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2005-02-03 20:11:28 +0000
committerThomas Heller <theller@ctypes.org>2005-02-03 20:11:28 +0000
commit8abe7bfb2f5b231a71f9bd10d2c52680c545f87a (patch)
tree75990b970e86447a75801ebda7a2a308fad7ffe4 /PC/bdist_wininst
parentfix XMLFilterBase.resolveEntity() so the caller gets the result (diff)
downloadcpython-8abe7bfb2f5b231a71f9bd10d2c52680c545f87a.tar.gz
cpython-8abe7bfb2f5b231a71f9bd10d2c52680c545f87a.tar.bz2
cpython-8abe7bfb2f5b231a71f9bd10d2c52680c545f87a.zip
Set PYTHONHOME before loading Python, so that sys.path will be set correctly.
Already backported.
Diffstat (limited to 'PC/bdist_wininst')
-rw-r--r--PC/bdist_wininst/install.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c
index e6e673144d1..eb65d4cbaf4 100644
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -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,