mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-40679: Use the function's qualname in certain TypeErrors (GH-20236)
Patch by Dennis Sweeney.
This commit is contained in:
parent
7c30d12bd5
commit
b5cc2089cc
4 changed files with 68 additions and 16 deletions
|
@ -63,7 +63,8 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
|
|||
pass
|
||||
with self.assertRaises(TypeError) as exc:
|
||||
f(1, 2, 3)
|
||||
expected = "f() takes from 1 to 2 positional arguments but 3 were given"
|
||||
expected = (f"{f.__qualname__}() takes from 1 to 2 "
|
||||
"positional arguments but 3 were given")
|
||||
self.assertEqual(str(exc.exception), expected)
|
||||
|
||||
def testSyntaxErrorForFunctionCall(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue