From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:06:26 +0000 (+0200) Subject: [3.13] gh-125811: Remove DeprecationWarnings in test_peg_generator (GH-125812) (... X-Git-Tag: v3.13.1~251 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3bfe1e756d2eb3d02daadcc3579b08c99b20dbf;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-125811: Remove DeprecationWarnings in test_peg_generator (GH-125812) (#125831) gh-125811: Remove DeprecationWarnings in test_peg_generator (GH-125812) (cherry picked from commit 4efe64aa56e7a9a96b94c0ae0201db8d402a5f53) Co-authored-by: Mikhail Efimov --- diff --git a/Lib/test/test_peg_generator/test_pegen.py b/Lib/test/test_peg_generator/test_pegen.py index 86db767b99a2..54c9dce2d0c9 100644 --- a/Lib/test/test_peg_generator/test_pegen.py +++ b/Lib/test/test_peg_generator/test_pegen.py @@ -484,7 +484,7 @@ class TestPegen(unittest.TestCase): def test_python_expr(self) -> None: grammar = """ - start: expr NEWLINE? $ { ast.Expression(expr, lineno=1, col_offset=0) } + start: expr NEWLINE? $ { ast.Expression(expr) } expr: ( expr '+' term { ast.BinOp(expr, ast.Add(), term, lineno=expr.lineno, col_offset=expr.col_offset, end_lineno=term.end_lineno, end_col_offset=term.end_col_offset) } | expr '-' term { ast.BinOp(expr, ast.Sub(), term, lineno=expr.lineno, col_offset=expr.col_offset, end_lineno=term.end_lineno, end_col_offset=term.end_col_offset) } | term { term } @@ -893,7 +893,7 @@ class TestPegen(unittest.TestCase): def test_locations_in_alt_action_and_group(self) -> None: grammar = """ - start: t=term NEWLINE? $ { ast.Expression(t, LOCATIONS) } + start: t=term NEWLINE? $ { ast.Expression(t) } term: | l=term '*' r=factor { ast.BinOp(l, ast.Mult(), r, LOCATIONS) } | l=term '/' r=factor { ast.BinOp(l, ast.Div(), r, LOCATIONS) }