diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index e665abad9b9e85..5422c861ffb5c0 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -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'"): diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index cd70b8784ebb5c..9961d23629abc5 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -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; } diff --git a/Python/Python-ast.c b/Python/Python-ast.c index d2e5fcc20e65d6..7aa1c5119d8f28 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -5233,8 +5233,8 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) 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; }