Skip to content

Commit c63d7c9

Browse files
gh-101614: Don't treat python3_d.dll as a Python DLL when checking extension modules for incompatibility (GH-101615)
(cherry picked from commit 3a88de7) Co-authored-by: David Hewitt <[email protected]>
1 parent c51cd54 commit c63d7c9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
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

+5-4
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,15 @@ static char *GetPythonImport (HINSTANCE hModule)
123123
!strncmp(import_name,"python",6)) {
124124
char *pch;
125125

126-
#ifndef _DEBUG
127-
/* In a release version, don't claim that python3.dll is
128-
a Python DLL. */
126+
/* Don't claim that python3.dll is a Python DLL. */
127+
#ifdef _DEBUG
128+
if (strcmp(import_name, "python3_d.dll") == 0) {
129+
#else
129130
if (strcmp(import_name, "python3.dll") == 0) {
131+
#endif
130132
import_data += 20;
131133
continue;
132134
}
133-
#endif
134135

135136
/* Ensure python prefix is followed only
136137
by numbers to the end of the basename */

0 commit comments

Comments
 (0)