greatly improve argument parsing error messages (closes #12265)

This commit is contained in:
Benjamin Peterson 2011-06-05 22:04:07 -05:00
parent 40b408d455
commit b204a42383
5 changed files with 307 additions and 204 deletions

View file

@ -78,7 +78,7 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
pass
with self.assertRaises(TypeError) as exc:
f(1, 2, 3)
expected = "f() takes at most 2 positional arguments (3 given)"
expected = "f() takes from 1 to 2 positional arguments but 3 were given"
self.assertEqual(str(exc.exception), expected)
def testSyntaxErrorForFunctionCall(self):