[Q]: Crash using Python 2.0 Extension

Ken Koller kkoller at newfocus.com
Thu Jan 25 13:34:01 EST 2001


Hi,

I originally wrote the routine below to return Py_None, but the
interpretter would crash after calling the routine several times (maybe
100-200) in a row. At first I thought it had something to do with the
routines I was calling from my DLL (even though the worked fine when
called from C++), but I commented out all the code except for the return
statement and it still crashed. I noticed that my routines that used
"built" return values seemed to be fine. So I added bogus return values
(doesn't hurt really) and everything is fine.

Am I missing something. I found it hard to believe someone hasn't seen
this problem. I'm running 2.0 on WinNT4.0.

Thanks,

Ken

static PyObject * pt_pSetModule(PyObject * self, PyObject * args)
{
 u8 i;

 if (!PyArg_ParseTuple(args, "b", &i)) return NULL;

 pSetModule(i);

 return Py_BuildValue("i", 0);
}





More information about the Python-list mailing list