Skip to content

Commit 1922df2

Browse files
yoneymeta-codesync[bot]
authored andcommitted
Support free-threaded versions in HIR fixture updater
Summary: Accept 3.Xt versions and normalize them for C++ fixture selection. Reviewed By: mpage Differential Revision: D114725868 fbshipit-source-id: 07cdcdea9caf9135b19cab84f7cf6c8ed0621461
1 parent 3598a28 commit 1922df2

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

cinderx/TestScripts/update_hir_expected.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,16 +450,13 @@ def update_cpp_tests( # noqa: C901
450450
failed_cpp_tests: set[tuple[str, str]],
451451
py_version: str,
452452
) -> None:
453-
# Validate Python version format
454-
try:
455-
parts = py_version.split(".")
456-
if len(parts) != 2 or parts[0] != "3":
457-
raise ValueError()
458-
int(parts[1]) # Ensure minor version is a number
459-
except (ValueError, IndexError):
453+
version_match = re.fullmatch(r"(3\.\d+)t?", py_version)
454+
if version_match is None:
460455
raise AssertionError(
461-
f"Invalid Python version format: {py_version}. Expected format: '3.X'"
456+
f"Invalid Python version format: {py_version}. "
457+
"Expected format: '3.X' or '3.Xt'"
462458
)
459+
py_version = version_match[1]
463460

464461
def expect_state(estate: State) -> None:
465462
nonlocal state, lineno, cpp_filename

0 commit comments

Comments
 (0)