Commits

Armin Rigo committed 68e7e82

Improve the error message when we mistype a keyword argument in unwrap_spec()

  • Participants
  • Parent commits 63aab71

Comments (0)

Files changed (1)

pypy/interpreter/gateway.py

 
     # apply kw_spec
     for name, spec in kw_spec.items():
-        unwrap_spec[argnames.index(name)] = spec
+        try:
+            unwrap_spec[argnames.index(name)] = spec
+        except ValueError:
+            raise ValueError("unwrap_spec() got a keyword %r but it is not "
+                             "the name of an argument of the following "
+                             "function" % (name,))
 
     return unwrap_spec