Skip to content

Commit 3a88de7

Browse files
authored
gh-101614: Don't treat python3_d.dll as a Python DLL when checking extension modules for incompatibility (GH-101615)
1 parent eb49d32 commit 3a88de7

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
@@ -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)