diff Python/dynload_win.c @ 66664:62b61abd02b8

Merge branches/pep-0384.
author Martin v. Löwis <martin@v.loewis.de>
date Fri, 03 Dec 2010 20:14:31 +0000
parents cab14be0ada1
children 0874698b1201
line wrap: on
line diff
--- a/Python/dynload_win.c	Fri Dec 03 19:59:41 2010 +0000
+++ b/Python/dynload_win.c	Fri Dec 03 20:14:31 2010 +0000
@@ -134,6 +134,15 @@
                 !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 @@
     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);
 
     {