Kaydet (Commit) ed70c403 authored tarafından Thomas Heller's avatar Thomas Heller

Backport from trunk, rev. 1.11 and 1.12. Don't hardcode the Python

version number.
üst 05a24d7f
...@@ -1510,12 +1510,15 @@ static void CloseLogfile(void) ...@@ -1510,12 +1510,15 @@ static void CloseLogfile(void)
static HINSTANCE LoadPythonDll(char *fname) static HINSTANCE LoadPythonDll(char *fname)
{ {
char fullpath[_MAX_PATH]; char fullpath[_MAX_PATH];
char subkey_name[80];
LONG size = sizeof(fullpath); LONG size = sizeof(fullpath);
HINSTANCE h = LoadLibrary(fname); HINSTANCE h = LoadLibrary(fname);
if (h) if (h)
return h; return h;
if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER, wsprintf(subkey_name,
"SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath", "SOFTWARE\\Python\\PythonCore\\%d.%d\\InstallPath",
py_major, py_minor);
if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER, subkey_name,
fullpath, &size)) fullpath, &size))
return NULL; return NULL;
strcat(fullpath, "\\"); strcat(fullpath, "\\");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment