Skip to content

Commit

Permalink
pythongh-101614: Don't treat python3_d.dll as a Python DLL when check…
Browse files Browse the repository at this point in the history
…ing extension modules for incompatibility (pythonGH-101615)

(cherry picked from commit 3a88de7)

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
  • Loading branch information
davidhewitt authored and miss-islington committed Feb 8, 2023
1 parent 5f0b819 commit fed02dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correctly handle extensions built against debug binaries that reference ``python3_d.dll``.
9 changes: 5 additions & 4 deletions Python/dynload_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit fed02dd

Please sign in to comment.