Back out of a recent policy change (Mark Hammond disagreed).

The registry always comes first and the default is always appended.
This commit is contained in:
Guido van Rossum 1998-08-11 20:35:56 +00:00
parent d10552379d
commit 24edfbb61d
1 changed files with 8 additions and 27 deletions

View File

@ -164,17 +164,6 @@ search_for_prefix(argv0_path, landmark)
#define BUILD_LANDMARK "PC\\getpathp.c" #define BUILD_LANDMARK "PC\\getpathp.c"
#endif #endif
static int
prefixisbuilddir()
{
int n = strlen(prefix);
int ok;
join(prefix, BUILD_LANDMARK);
ok = exists(prefix);
prefix[n] = '\0';
return ok;
}
#include "malloc.h" // for alloca - see comments below! #include "malloc.h" // for alloca - see comments below!
extern const char *PyWin_DLLVersionString; // a string loaded from the DLL at startup. extern const char *PyWin_DLLVersionString; // a string loaded from the DLL at startup.
@ -364,16 +353,14 @@ calculate_path()
envpath = NULL; envpath = NULL;
#ifdef MS_WIN32 #ifdef MS_WIN32
if (!prefixisbuilddir()) { /* Are we running under Windows 3.1(1) Win32s? */
/* Are we running under Windows 3.1(1) Win32s? */ if (PyWin_IsWin32s()) {
if (PyWin_IsWin32s()) { /* Only CLASSES_ROOT is supported */
/* Only CLASSES_ROOT is supported */ machinepath = getpythonregpath(HKEY_CLASSES_ROOT, TRUE);
machinepath = getpythonregpath(HKEY_CLASSES_ROOT, TRUE); userpath = NULL;
userpath = NULL; } else {
} else { machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, FALSE);
machinepath = getpythonregpath(HKEY_LOCAL_MACHINE, FALSE); userpath = getpythonregpath(HKEY_CURRENT_USER, FALSE);
userpath = getpythonregpath(HKEY_CURRENT_USER, FALSE);
}
} }
#endif #endif
@ -404,8 +391,6 @@ calculate_path()
bufsz += strlen(PYTHONPATH) + 1; bufsz += strlen(PYTHONPATH) + 1;
bufsz += strlen(argv0_path) + 1; bufsz += strlen(argv0_path) + 1;
#ifdef MS_WIN32 #ifdef MS_WIN32
if (userpath || machinepath)
bufsz = 0; /* Reset! */
if (userpath) if (userpath)
bufsz += strlen(userpath) + 1; bufsz += strlen(userpath) + 1;
if (machinepath) if (machinepath)
@ -453,10 +438,6 @@ calculate_path()
*buf++ = DELIM; *buf++ = DELIM;
free(machinepath); free(machinepath);
} }
if (userpath || machinepath) {
buf[-1] = '\0';
return;
}
#endif #endif
if (pythonhome == NULL) { if (pythonhome == NULL) {
strcpy(buf, PYTHONPATH); strcpy(buf, PYTHONPATH);