diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-06 15:45:38 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-06 15:45:38 (GMT) |
commit | 478d47a168bf45da9014ac1a299a222726eda058 (patch) | |
tree | b83b214c1c16891fac46710ee6ac619da3a08256 /Objects/abstract.c | |
parent | 56f46f8d8c1af1cf150df61f5aeafa40ca0b18e5 (diff) | |
download | cpython-478d47a168bf45da9014ac1a299a222726eda058.zip cpython-478d47a168bf45da9014ac1a299a222726eda058.tar.gz cpython-478d47a168bf45da9014ac1a299a222726eda058.tar.bz2 |
Close SF bug 563740. complex() now finds __complex__() in new style classes.
Made conversion failure error messages consistent between types.
Added related unittests.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 917195a..1f9b603 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -903,7 +903,7 @@ PyNumber_Int(PyObject *o) if (!PyObject_AsCharBuffer(o, &buffer, &buffer_len)) return int_from_string((char*)buffer, buffer_len); - return type_error("object can't be converted to int"); + return type_error("int() argument must be a string or a number"); } /* Add a check for embedded NULL-bytes in the argument. */ @@ -960,7 +960,7 @@ PyNumber_Long(PyObject *o) if (!PyObject_AsCharBuffer(o, &buffer, &buffer_len)) return long_from_string(buffer, buffer_len); - return type_error("object can't be converted to long"); + return type_error("long() argument must be a string or a number"); } PyObject * |