[Python-checkins] python/dist/src/PC/bdist_wininst install.c, 1.13, 1.14

theller at users.sourceforge.net theller at users.sourceforge.net
Thu Feb 3 21:11:31 CET 2005


Update of /cvsroot/python/python/dist/src/PC/bdist_wininst
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18261

Modified Files:
	install.c 
Log Message:
Set PYTHONHOME before loading Python, so that sys.path will be set correctly.

Already backported.


Index: install.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/install.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- install.c	22 Dec 2004 17:24:14 -0000	1.13
+++ install.c	3 Feb 2005 20:11:28 -0000	1.14
@@ -613,7 +613,13 @@
 	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,



More information about the Python-checkins mailing list