extension and core dumpage
Doug Epps
doug at tippett.com
Thu Aug 26 20:28:54 EDT 1999
hi,
i'm trying to experiment with extending python with c/c++
and getting the following message on 'import '
Fatal Python error: PyThreadState_Get: no current thread
Abort (core dumped)
SGI IRIX 6.3
the extension code is really simple
any ideas or pointers would be great.
please email too, i dont trust our news server
doug
## here's the code
#include <Python.h>
static PyObject *ErrorObject;
extern "C" {
void initdougTest ();
};
static PyObject *top (PyObject *, PyObject *) {
Py_INCREF(Py_None);
return (Py_None);
}
static struct PyMethodDef dougMethods[] ={
{ "top", top, 1, "the stuff"},
{NULL, NULL, 0}
};
void initdougTest ()
{
PyObject *m, *d;
m=Py_InitModule ("dougTest", dougMethods);
d=PyModule_GetDict (m);
//ErrorObject=Py_BuildValue ("s", "dougTest.error");
ErrorObject=PyString_FromString ("multiarray.error");
PyDict_SetItemString (d, "error", ErrorObject);
if (PyErr_Occurred ()) {
Py_FatalError ("cant init module dougTest");
}
}
--
Doug Epps -- Tippett Studio
510 649 9711 (voice)
510 649 9399 (fax)
doug at tippett.com
More information about the Python-list
mailing list