3 typedef struct _ts { } PyThreadState;
4 PyThreadState * Py_NewInterpreter(void);
5 void Py_EndInterpreter(PyThreadState *);
6 class ApplicationError {
8 ApplicationError(std::string errormsg) : errormsg(errormsg) { }
13 PyThreadState *py_state=__null;
15 if (!(py_state=Py_NewInterpreter()))
16 throw ApplicationError("error");
18 catch(ApplicationError e) {
19 Py_EndInterpreter(py_state);