diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-05-03 20:27:03 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2007-05-03 20:27:03 (GMT) |
commit | f030394de333ed645e7f1139e2e42f43444efb73 (patch) | |
tree | 3c9a6131bcfa6edeb265c63f2a531adc00d05214 /Objects/intobject.c | |
parent | 170eee9d6ae4ad4270cfd164c046c2381d746191 (diff) | |
download | cpython-f030394de333ed645e7f1139e2e42f43444efb73.zip cpython-f030394de333ed645e7f1139e2e42f43444efb73.tar.gz cpython-f030394de333ed645e7f1139e2e42f43444efb73.tar.bz2 |
Fix problems in x64 build that were discovered by the testsuite:
- Reenable modules on x64 that had been disabled aeons ago for Itanium.
- Cleared up confusion about compilers for 64 bit windows. There is only Itanium and x64. Added macros MS_WINI64 and MS_WINX64 for those rare cases where it matters, such as the disabling of modules above.
- Set target platform (_WIN32_WINNT and WINVER) to 0x0501 (XP) for x64, and 0x0400 (NT 4.0) otherwise, which are the targeted minimum platforms.
- Fixed thread_nt.h. The emulated InterlockedCompareExchange function didn´t work on x64, probaby due to the lack of a "volatile" specifier. Anyway, win95 is no longer a target platform.
- Itertools module used wrong constant to check for overflow in count()
- PyInt_AsSsize_t couldn't deal with attribute error when accessing the __long__ member.
- PyLong_FromSsize_t() incorrectly specified that the operand were unsigned.
With these changes, the x64 passes the testsuite, for those modules present.
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r-- | Objects/intobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c index 9ffc295..a82b3c8 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -215,6 +215,10 @@ PyInt_AsSsize_t(register PyObject *op) 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 { io = (PyIntObject*) (*nb->nb_int) (op); } |