summaryrefslogtreecommitdiffstats
path: root/Objects/intobject.c
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-07 16:46:54 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-07 16:46:54 (GMT)
commitabe1d48d2068ef0fea36a9b370a8b159ab267430 (patch)
tree18126c32358db7927b5fc5c59d9bb6ba110d17c5 /Objects/intobject.c
parent58e123d75ef5858fcae7c52cd0b2dc412f4dd316 (diff)
downloadcpython-abe1d48d2068ef0fea36a9b370a8b159ab267430.zip
cpython-abe1d48d2068ef0fea36a9b370a8b159ab267430.tar.gz
cpython-abe1d48d2068ef0fea36a9b370a8b159ab267430.tar.bz2
As per Armin Rigo's suggestion, remove special handing from intobject.c to deal with the peculiarities of classobject's implementation of the number protocol. The nb_long method of classobject now falls back to nb_int if there is no __long__ attribute present.
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r--Objects/intobject.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index a82b3c8..9333a55 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -213,15 +213,10 @@ PyInt_AsSsize_t(register PyObject *op)
return -1;
}
- if (nb->nb_long != 0) {
+ if (nb->nb_long != 0)
io = (PyIntObject*) (*nb->nb_long) (op);
- if (io == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Clear();
- io = (PyIntObject*) (*nb->nb_int) (op);
- }
- } else {
+ else
io = (PyIntObject*) (*nb->nb_int) (op);
- }
if (io == NULL)
return -1;
if (!PyInt_Check(io)) {