[Python-checkins] python/dist/src/PC/bdist_wininst install.c, 1.1.14.8, 1.1.14.9

theller at users.sourceforge.net theller at users.sourceforge.net
Tue Jan 25 20:47:58 CET 2005


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

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


Index: install.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/install.c,v
retrieving revision 1.1.14.8
retrieving revision 1.1.14.9
diff -u -d -r1.1.14.8 -r1.1.14.9
--- install.c	22 Dec 2004 15:46:01 -0000	1.1.14.8
+++ install.c	25 Jan 2005 19:47:48 -0000	1.1.14.9
@@ -1511,8 +1511,14 @@
 {
 	char fullpath[_MAX_PATH];
 	char subkey_name[80];
+	char buffer[260 + 12];
 	LONG size = sizeof(fullpath);
-	HINSTANCE h = LoadLibrary(fname);
+	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