diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-05-07 16:46:54 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-05-07 16:46:54 (GMT) |
commit | abe1d48d2068ef0fea36a9b370a8b159ab267430 (patch) | |
tree | 18126c32358db7927b5fc5c59d9bb6ba110d17c5 /Objects/intobject.c | |
parent | 58e123d75ef5858fcae7c52cd0b2dc412f4dd316 (diff) | |
download | cpython-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.c | 9 |
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)) { |