Skip to content

Commit

Permalink
gh-110119: Fix test_importlib --disable-gil Windows test failures (#…
Browse files Browse the repository at this point in the history
…110422)

Use "t" in the expected tag for `--disable-gil` builds in test_tagged_suffix.
  • Loading branch information
colesbury committed Oct 5, 2023
1 parent 5eae8dc commit 3c2f321
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Lib/test/test_importlib/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import re
import sys
import sysconfig
import unittest
from test.support import import_helper
from contextlib import contextmanager
Expand Down Expand Up @@ -111,8 +112,10 @@ def test_module_not_found(self):
class WindowsExtensionSuffixTests:
def test_tagged_suffix(self):
suffixes = self.machinery.EXTENSION_SUFFIXES
expected_tag = ".cp{0.major}{0.minor}-{1}.pyd".format(sys.version_info,
re.sub('[^a-zA-Z0-9]', '_', get_platform()))
abi_flags = "t" if sysconfig.get_config_var("Py_NOGIL") else ""
ver = sys.version_info
platform = re.sub('[^a-zA-Z0-9]', '_', get_platform())
expected_tag = f".cp{ver.major}{ver.minor}{abi_flags}-{platform}.pyd"
try:
untagged_i = suffixes.index(".pyd")
except ValueError:
Expand Down

0 comments on commit 3c2f321

Please sign in to comment.