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
This commit is contained in:
William S Fulton 2012-04-14 17:30:03 +00:00
commit 68a135860d
3 changed files with 4 additions and 7 deletions

View file

@ -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()) {