Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tweaks
  • Loading branch information
JelleZijlstra committed May 9, 2024
commit 03898833c502e1ff2b8db20ae8c9c326e062c396
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.