]> granicus.if.org Git - python/commitdiff
don't count keyword arguments as positional #9943
authorBenjamin Peterson <benjamin@python.org>
Sat, 25 Sep 2010 03:14:33 +0000 (03:14 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 25 Sep 2010 03:14:33 +0000 (03:14 +0000)
Misc/NEWS
Python/ceval.c

index 489d6a96735937c6223767ced18c944e0a6ea6e1..8d7f3287e26675e3fdeda8acb30d6b648c1319f9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.2 Alpha 3?
 Core and Builtins
 -----------------
 
+- Issue #9943: Improve the TypeError raised for passing too many positional
+  arguments.
+
 - Issue #9930: Remove bogus subtype check that was causing (e.g.)
   float.__rdiv__(2.0, 3) to return NotImplemented instead of the
   expected 1.5.
index 48b567865296ff15ea6d769f130669262b194ad9..84781be32f824850e30372503d398548503658f9 100644 (file)
@@ -3104,7 +3104,7 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
                     defcount ? "at most" : "exactly",
                     co->co_argcount,
                     co->co_argcount == 1 ? "" : "s",
-                    argcount + kwcount);
+                    argcount);
                 goto fail;
             }
             n = co->co_argcount;