From: Marcelo M. <mar...@us...> - 2005-05-26 20:43:42
|
Update of /cvsroot/swig/SWIG/Lib/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22293 Modified Files: pycontainer.swg pystrings.swg pywstrings.swg std_map.i std_multimap.i Log Message: fix #1188207 and uniform the error/null/none handling Index: std_multimap.i =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/std_multimap.i,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** std_multimap.i 26 Feb 2005 20:25:10 -0000 1.8 --- std_multimap.i 26 May 2005 20:43:33 -0000 1.9 *************** *** 44,49 **** PyErr_SetString(PyExc_OverflowError, "multimap size not valid in python"); ! Py_INCREF(Py_None); ! return Py_None; } PyObject *obj = PyDict_New(); --- 44,48 ---- PyErr_SetString(PyExc_OverflowError, "multimap size not valid in python"); ! return NULL; } PyObject *obj = PyDict_New(); Index: pycontainer.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/pycontainer.swg,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pycontainer.swg 26 Feb 2005 20:25:10 -0000 1.7 --- pycontainer.swg 26 May 2005 20:43:32 -0000 1.8 *************** *** 614,619 **** PyErr_SetString(PyExc_OverflowError, "sequence size not valid in python"); ! Py_INCREF(Py_None); ! return Py_None; } } --- 614,618 ---- PyErr_SetString(PyExc_OverflowError, "sequence size not valid in python"); ! return NULL; } } Index: pystrings.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/pystrings.swg,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pystrings.swg 24 Feb 2005 23:48:19 -0000 1.15 --- pystrings.swg 26 May 2005 20:43:32 -0000 1.16 *************** *** 139,143 **** { if (size > INT_MAX) { ! return Py_None; } else { return PyString_FromStringAndSize(carray, SWIG_numeric_cast(size,int)); --- 139,144 ---- { if (size > INT_MAX) { ! return SWIG_NewPointerObj(SWIG_const_cast(carray,char *), ! SWIG_TypeQuery("char *"), 0); } else { return PyString_FromStringAndSize(carray, SWIG_numeric_cast(size,int)); Index: std_map.i =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/std_map.i,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** std_map.i 26 Feb 2005 20:25:10 -0000 1.12 --- std_map.i 26 May 2005 20:43:33 -0000 1.13 *************** *** 44,49 **** PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! Py_INCREF(Py_None); ! return Py_None; } PyObject *obj = PyDict_New(); --- 44,48 ---- PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! return NULL; } PyObject *obj = PyDict_New(); *************** *** 94,99 **** PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! Py_INCREF(Py_None); ! return Py_None; } PyObject* keyList = PyList_New(pysize); --- 93,97 ---- PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! return NULL; } PyObject* keyList = PyList_New(pysize); *************** *** 111,116 **** PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! Py_INCREF(Py_None); ! return Py_None; } PyObject* valList = PyTuple_New(pysize); --- 109,113 ---- PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! return NULL; } PyObject* valList = PyTuple_New(pysize); *************** *** 128,133 **** PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! Py_INCREF(Py_None); ! return Py_None; } PyObject* itemList = PyTuple_New(pysize); --- 125,129 ---- PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! return NULL; } PyObject* itemList = PyTuple_New(pysize); *************** *** 150,155 **** PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! Py_INCREF(Py_None); ! return Py_None; } PyObject* keyTuple = PyTuple_New(pysize); --- 146,150 ---- PyErr_SetString(PyExc_OverflowError, "map size not valid in python"); ! return NULL; } PyObject* keyTuple = PyTuple_New(pysize); Index: pywstrings.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/pywstrings.swg,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pywstrings.swg 24 Feb 2005 23:48:20 -0000 1.11 --- pywstrings.swg 26 May 2005 20:43:32 -0000 1.12 *************** *** 133,138 **** { if (size > INT_MAX) { ! SWIG_NewPointerObj(SWIG_const_cast(carray,wchar_t *), SWIG_TypeQuery("wchar_t *"), 0); ! return Py_None; } else { return PyUnicode_FromWideChar(carray, SWIG_numeric_cast(size,int)); --- 133,138 ---- { if (size > INT_MAX) { ! return SWIG_NewPointerObj(SWIG_const_cast(carray,wchar_t *), ! SWIG_TypeQuery("wchar_t *"), 0); } else { return PyUnicode_FromWideChar(carray, SWIG_numeric_cast(size,int)); |