Skip to content

Commit fed02dd

Browse files
davidhewittmiss-islington
authored andcommitted
pythongh-101614: Don't treat python3_d.dll as a Python DLL when checking extension modules for incompatibility (pythonGH-101615)
(cherry picked from commit 3a88de7) Co-authored-by: David Hewitt <[email protected]>
1 parent 5f0b819 commit fed02dd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Correctly handle extensions built against debug binaries that reference ``python3_d.dll``.

Python/dynload_win.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,15 @@ static char *GetPythonImport (HINSTANCE hModule)
125125
!strncmp(import_name,"python",6)) {
126126
char *pch;
127127

128-
#ifndef _DEBUG
129-
/* In a release version, don't claim that python3.dll is
130-
a Python DLL. */
128+
/* Don't claim that python3.dll is a Python DLL. */
129+
#ifdef _DEBUG
130+
if (strcmp(import_name, "python3_d.dll") == 0) {
131+
#else
131132
if (strcmp(import_name, "python3.dll") == 0) {
133+
#endif
132134
import_data += 20;
133135
continue;
134136
}
135-
#endif
136137

137138
/* Ensure python prefix is followed only
138139
by numbers to the end of the basename */

0 commit comments

Comments
 (0)