From 68a135860d0da197639ea707e802b425df93fa76 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 14 Apr 2012 17:30:03 +0000 Subject: [PATCH] Revert rev 12835 as it introduces a failure in the test-suite (primitive_types test) git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12983 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 3 --- Lib/python/pyhead.swg | 1 - Lib/python/pyprimtypes.swg | 7 ++++--- 3 files changed, 4 insertions(+), 7 deletions(-) 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()) {