]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101614: Don't treat python3_d.dll as a Python DLL when checking extension modules...
authorDavid Hewitt <1939362+davidhewitt@users.noreply.github.com>
Wed, 8 Feb 2023 14:23:57 +0000 (14:23 +0000)
committerGitHub <noreply@github.com>
Wed, 8 Feb 2023 14:23:57 +0000 (14:23 +0000)
Misc/NEWS.d/next/Windows/2023-02-07-18-22-54.gh-issue-101614.NjVP0n.rst [new file with mode: 0644]
Python/dynload_win.c

diff --git a/Misc/NEWS.d/next/Windows/2023-02-07-18-22-54.gh-issue-101614.NjVP0n.rst b/Misc/NEWS.d/next/Windows/2023-02-07-18-22-54.gh-issue-101614.NjVP0n.rst
new file mode 100644 (file)
index 0000000..8ed0995
--- /dev/null
@@ -0,0 +1 @@
+Correctly handle extensions built against debug binaries that reference ``python3_d.dll``.
index c03bc5602bffeed3eb99ebeac3046fd43d494b46..7bd04d573df4adf284ebcdbadca564b71c5dde07 100644 (file)
@@ -125,14 +125,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. */
+                /* Don't claim that python3.dll is a Python DLL. */
+#ifdef _DEBUG
+                if (strcmp(import_name, "python3_d.dll") == 0) {
+#else
                 if (strcmp(import_name, "python3.dll") == 0) {
+#endif
                     import_data += 20;
                     continue;
                 }
-#endif
 
                 /* Ensure python prefix is followed only
                    by numbers to the end of the basename */