diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index e325480e6c9208..93f2800a3c70dd 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -2192,7 +2192,7 @@ def test_invalid_positional_argument(self): def f(*args): pass msg = 'f requires at least 1 positional argument' - with self.assertRaisesRegexp(TypeError, msg): + with self.assertRaises(TypeError, msg=msg): f() if __name__ == '__main__':