[Python-checkins] cpython (merge 3.3 -> default): Merge: #7963: fix error message when 'object' called with arguments.

r.david.murray python-checkins at python.org
Tue Feb 19 03:44:41 CET 2013


http://hg.python.org/cpython/rev/1f3ce7ba410b
changeset:   82261:1f3ce7ba410b
parent:      82258:aa77f7eb2bf1
parent:      82260:0e438442fddf
user:        R David Murray <rdmurray at bitdance.com>
date:        Mon Feb 18 21:44:03 2013 -0500
summary:
  Merge: #7963: fix error message when 'object' called with arguments.

files:
  Misc/NEWS            |  3 +++
  Objects/typeobject.c |  2 +-
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
 Core and Builtins
 -----------------
 
+- Issue #7963: Fixed misleading error message that issued when object is
+  called without arguments.
+
 - Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob.
 
 - Issue #5308: Raise ValueError when marshalling too large object (a sequence
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3059,7 +3059,7 @@
 {
     if (excess_args(args, kwds) &&
         (type->tp_init == object_init || type->tp_new != object_new)) {
-        PyErr_SetString(PyExc_TypeError, "object.__new__() takes no parameters");
+        PyErr_SetString(PyExc_TypeError, "object() takes no parameters");
         return NULL;
     }
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list