Skip to content

Commit 81484c5

Browse files
hugovkAlexWaygoodAA-Turner
authored
gh-144639: Ruff: target Python 3.14 syntax in Lib/test (#144656)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 35dc547 commit 81484c5

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

Lib/test/.ruff.toml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
extend = "../../.ruff.toml" # Inherit the project-wide settings
22

3-
target-version = "py312"
3+
# Unlike Tools/, tests can use newer syntax than PYTHON_FOR_REGEN
4+
target-version = "py314"
45

56
extend-exclude = [
67
# Excluded (run with the other AC files in its own separate ruff job in pre-commit)
@@ -15,15 +16,6 @@ extend-exclude = [
1516
"test_grammar.py",
1617
]
1718

18-
[per-file-target-version]
19-
# Type parameter defaults
20-
"test_type_params.py" = "py313"
21-
22-
# Template string literals
23-
"test_annotationlib.py" = "py314"
24-
"test_string/test_templatelib.py" = "py314"
25-
"test_tstring.py" = "py314"
26-
2719
[lint]
2820
select = [
2921
"F401", # Unused import

Lib/test/support/import_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def make_legacy_pyc(source, allow_compile=False):
7171
try:
7272
pyc_file = importlib.util.cache_from_source(source)
7373
shutil.move(pyc_file, legacy_pyc)
74-
except (FileNotFoundError, NotImplementedError):
74+
except FileNotFoundError, NotImplementedError:
7575
if not allow_compile:
7676
raise
7777
py_compile.compile(source, legacy_pyc, doraise=True)

0 commit comments

Comments
 (0)