Skip to content

Commit 92ac6d1

Browse files
Review suggestions
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent f5b2582 commit 92ac6d1

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ ast
423423

424424
* The constructors of AST node types in the :mod:`ast` module now raise a
425425
:exc:`TypeError` when a required argument is omitted or when a
426-
keyword-argument that does not map to a field on the AST node is passed.
426+
keyword argument that does not map to a field on the AST node is passed.
427427
These cases had previously raised a :exc:`DeprecationWarning` since Python 3.13.
428428
(Contributed by Brian Schubert and Jelle Zijlstra in :gh:`137600` and :gh:`105858`.)
429429

Lib/test/test_ast/test_ast.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ def test_replace_ignore_known_custom_instance_fields(self):
14081408
self.assertRaises(AttributeError, getattr, repl, 'extra')
14091409

14101410
def test_replace_reject_missing_field(self):
1411-
# case: warn if deleted field is not replaced
1411+
# case: raise if deleted field is not replaced
14121412
node = ast.parse('x').body[0].value
14131413
context = node.ctx
14141414
del node.id
@@ -3297,8 +3297,8 @@ class MoreFieldsThanTypes(ast.AST):
32973297
a: int | None = None
32983298
b: int | None = None
32993299

3300-
msg = "Field 'b' is missing from test.test_ast.test_ast.ASTConstructorTests.test_incomplete_field_types.<locals>.MoreFieldsThanTypes._field_types"
3301-
with self.assertRaisesRegex(TypeError, re.escape(msg)):
3300+
msg = "Field 'b' is missing from .*\.MoreFieldsThanTypes\._field_types"
3301+
with self.assertRaisesRegex(TypeError, msg):
33023302
obj = MoreFieldsThanTypes()
33033303

33043304
obj = MoreFieldsThanTypes(a=1, b=2)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The constructors of node types in the :mod:`ast` module now raise a
22
:exc:`TypeError` when a required argument is omitted or when a
3-
keyword-argument that does not map to a field on the AST node is passed.
3+
keyword argument that does not map to a field on the AST node is passed.
44
These cases had previously raised a :exc:`DeprecationWarning` since Python
55
3.13. Patch by Brian Schubert.

0 commit comments

Comments
 (0)