diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-03-12 01:11:49 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2005-03-12 01:11:49 +0000 |
commit | a25fbd5159ec6ff2560ef9777c4e6f5f5b925511 (patch) | |
tree | 4a9e4b4c8cf5c06064ec5f5bdaae08ad9673ea70 /Lib/python | |
parent | af1068e3362e63396e197c519fa6e3700ca84a06 (diff) | |
download | swig-a25fbd5159ec6ff2560ef9777c4e6f5f5b925511.tar.gz |
fix seg fault when runtime fails
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7060 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/python')
-rw-r--r-- | Lib/python/pyrun.swg | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index ec5afa7fa..400417daf 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -686,6 +686,12 @@ type_error: SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) { PyObject *robj = 0; + if (!type) { + if (!PyErr_Occurred()) { + PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj"); + } + return robj; + } if (!ptr) { Py_INCREF(Py_None); return Py_None; |