diff --git a/Lib/test/test_type_params.py b/Lib/test/test_type_params.py index 96bd1fa0bab990..466e3bd43a68e5 100644 --- a/Lib/test/test_type_params.py +++ b/Lib/test/test_type_params.py @@ -843,5 +843,5 @@ def func[A](): func.__type_params__ = () """ - with self.assertRaisesRegex(AttributeError, "attribute '__type_params__' of 'function' objects is not writable"): - run_code(code) + ns = run_code(code) + self.assertEqual(ns["func"].__type_params__, ())