[Python-checkins] cpython (3.2): #7963: fix error message when 'object' called with arguments.

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


http://hg.python.org/cpython/rev/b5adf2a30b73
changeset:   82259:b5adf2a30b73
branch:      3.2
parent:      82256:0bbf7cdea551
user:        R David Murray <rdmurray at bitdance.com>
date:        Mon Feb 18 21:20:08 2013 -0500
summary:
  #7963: fix error message when 'object' called with arguments.

Patch by Alexander Belopolsky.

files:
  Misc/NEWS            |  3 +++
  Objects/typeobject.c |  4 ++--
  2 files changed, 5 insertions(+), 2 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 #5308: Raise ValueError when marshalling too large object (a sequence
   with size >= 2**31), instead of producing illegal marshal data.
 
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2842,14 +2842,14 @@
             type->tp_init != object_init)
         {
             err = PyErr_WarnEx(PyExc_DeprecationWarning,
-                       "object.__new__() takes no parameters",
+                       "object() takes no parameters",
                        1);
         }
         else if (type->tp_new != object_new ||
                  type->tp_init == object_init)
         {
             PyErr_SetString(PyExc_TypeError,
-                "object.__new__() takes no parameters");
+                "object() takes no parameters");
             err = -1;
         }
     }

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


More information about the Python-checkins mailing list