aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Windows/2023-02-07-18-22-54.gh-issue-101614.NjVP0n.rst1
-rw-r--r--Python/dynload_win.c9
2 files changed, 6 insertions, 4 deletions
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
index 0000000000..8ed0995d78
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2023-02-07-18-22-54.gh-issue-101614.NjVP0n.rst
@@ -0,0 +1 @@
+Correctly handle extensions built against debug binaries that reference ``python3_d.dll``.
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index 5702ab2cd7..96faa4b462 100644
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -123,14 +123,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 */