Skip to content

Commit 3c2f321

Browse files
authored
gh-110119: Fix test_importlib --disable-gil Windows test failures (#110422)
Use "t" in the expected tag for `--disable-gil` builds in test_tagged_suffix.
1 parent 5eae8dc commit 3c2f321

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_importlib/test_windows.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import re
66
import sys
7+
import sysconfig
78
import unittest
89
from test.support import import_helper
910
from contextlib import contextmanager
@@ -111,8 +112,10 @@ def test_module_not_found(self):
111112
class WindowsExtensionSuffixTests:
112113
def test_tagged_suffix(self):
113114
suffixes = self.machinery.EXTENSION_SUFFIXES
114-
expected_tag = ".cp{0.major}{0.minor}-{1}.pyd".format(sys.version_info,
115-
re.sub('[^a-zA-Z0-9]', '_', get_platform()))
115+
abi_flags = "t" if sysconfig.get_config_var("Py_NOGIL") else ""
116+
ver = sys.version_info
117+
platform = re.sub('[^a-zA-Z0-9]', '_', get_platform())
118+
expected_tag = f".cp{ver.major}{ver.minor}{abi_flags}-{platform}.pyd"
116119
try:
117120
untagged_i = suffixes.index(".pyd")
118121
except ValueError:

0 commit comments

Comments
 (0)