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.
This commit is contained in:
Sam Gross 2023-10-05 19:51:17 +00:00 committed by GitHub
parent 5eae8dc2cb
commit 3c2f3215cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@ machinery = test_util.import_importlib('importlib.machinery')
import os
import re
import sys
import sysconfig
import unittest
from test.support import import_helper
from contextlib import contextmanager
@ -111,8 +112,10 @@ class WindowsRegistryFinderTests:
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: