diff --git a/CHANGES.current b/CHANGES.current index 6f805126e..b6bc01ac8 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -219,9 +219,6 @@ Version 2.0.5 (in progress) 2011-11-11: wsfulton Fix pcre-build.sh to work with non-compressed tarballs - problem reported by Adrian Blakely. -2011-11-04: szager - [python] Bug 3429388: python unsigned integer handling on 32-bit architectures. - 2011-11-03: wsfulton Expand special variables in typemap warnings, eg: diff --git a/Lib/python/pyhead.swg b/Lib/python/pyhead.swg index 206b81a37..803cd0745 100644 --- a/Lib/python/pyhead.swg +++ b/Lib/python/pyhead.swg @@ -4,7 +4,6 @@ #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) #define PyInt_Check(x) PyLong_Check(x) #define PyInt_AsLong(x) PyLong_AsLong(x) -#define PyInt_AsUnsignedLongMask(x) PyLong_AsUnsignedLongMask(x) #define PyInt_FromLong(x) PyLong_FromLong(x) #define PyString_Check(name) PyBytes_Check(name) #define PyString_FromString(x) PyUnicode_FromString(x) diff --git a/Lib/python/pyprimtypes.swg b/Lib/python/pyprimtypes.swg index 43a3375b7..aa5ddaf62 100644 --- a/Lib/python/pyprimtypes.swg +++ b/Lib/python/pyprimtypes.swg @@ -100,12 +100,13 @@ SWIGINTERN int SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val) { if (PyInt_Check(obj)) { - unsigned long v = PyInt_AsUnsignedLongMask(obj); - if (!PyErr_Occurred()) { + long v = PyInt_AsLong(obj); + if (v >= 0) { if (val) *val = v; return SWIG_OK; + } else { + return SWIG_OverflowError; } - PyErr_Clear(); } else if (PyLong_Check(obj)) { unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) {