Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed May 9, 2024
1 parent 83d76cd commit 0389883
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Lib/test/test_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3039,15 +3039,15 @@ def test_FunctionDef(self):
def test_expr_context(self):
name = ast.Name("x")
self.assertEqual(name.id, "x")
self.assertEqual(name.ctx, ast.Load())
self.assertIsInstance(name.ctx, ast.Load)

name2 = ast.Name("x", ast.Store())
self.assertEqual(name2.id, "x")
self.assertEqual(name2.ctx, ast.Store())
self.assertIsInstance(name2.ctx, ast.Store)

name3 = ast.Name("x", ctx=ast.Del())
self.assertEqual(name3.id, "x")
self.assertEqual(name3.ctx, ast.Del())
self.assertIsInstance(name3.ctx, ast.Del)

with self.assertWarnsRegex(DeprecationWarning,
r"Name\.__init__ missing 1 required positional argument: 'id'"):
Expand Down
4 changes: 2 additions & 2 deletions Parser/asdl_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ def visitModule(self, mod):
if (PyErr_WarnFormat(
PyExc_DeprecationWarning, 1,
"%.400s.__init__ missing 1 required positional argument: '%U'. "
"This will become an error in Python 3.15. %R",
Py_TYPE(self)->tp_name, name, type
"This will become an error in Python 3.15.",
Py_TYPE(self)->tp_name, name
) < 0) {
goto set_remaining_cleanup;
}
Expand Down
4 changes: 2 additions & 2 deletions Python/Python-ast.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0389883

Please sign in to comment.