summaryrefslogtreecommitdiff
path: root/Python/dynload_win.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-03-28 13:53:40 +0300
committerEzio Melotti <ezio.melotti@gmail.com>2011-03-28 13:53:40 +0300
commitdce235203d23310e1ca12e8a8a8ed8be8e585a12 (patch)
tree7a3b79eef005b8881e3175189ff9db64dd36e2f7 /Python/dynload_win.c
parent23bb1f0966b9d6b169f929dac91163cec082b741 (diff)
parente5b28bc7ccd71ef30cfee95b1ead7c91c2fdaa8d (diff)
downloadcpython-dce235203d23310e1ca12e8a8a8ed8be8e585a12.tar.gz
#10617: merge with 3.1.
Diffstat (limited to 'Python/dynload_win.c')
-rw-r--r--Python/dynload_win.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index e7d61ce8e0..73a1dcf897 100644
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -134,6 +134,15 @@ static char *GetPythonImport (HINSTANCE hModule)
!strncmp(import_name,"python",6)) {
char *pch;
+#ifndef _DEBUG
+ /* In a release version, don't claim that python3.dll is
+ a Python DLL. */
+ if (strcmp(import_name, "python3.dll") == 0) {
+ import_data += 20;
+ continue;
+ }
+#endif
+
/* Ensure python prefix is followed only
by numbers to the end of the basename */
pch = import_name + 6;
@@ -162,13 +171,16 @@ static char *GetPythonImport (HINSTANCE hModule)
return NULL;
}
-
dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
const char *pathname, FILE *fp)
{
dl_funcptr p;
char funcname[258], *import_python;
+#ifndef _DEBUG
+ _Py_CheckPython3();
+#endif
+
PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname);
{