From 5376005e3c82ab7a3464ca6405696916f8f2e6bd Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Thu, 3 Nov 2005 20:36:42 +0000 Subject: display error messages if calling __init__ or _del caused an exception updated docs compiler flag to exclude DSP objects pyext: fix for missing __init__ attribute some ASSERTs for explicitly created pyext classes (should be runtime checks i guess) let _inlets and _outlets default to 0 svn path=/trunk/; revision=3829 --- externals/grill/py/py.vcproj | 4 +-- externals/grill/py/readme.txt | 72 ++++++++++++++++++++----------------- externals/grill/py/source/pyext.cpp | 11 +++--- 3 files changed, 47 insertions(+), 40 deletions(-) (limited to 'externals/grill/py') diff --git a/externals/grill/py/py.vcproj b/externals/grill/py/py.vcproj index d82a132f..5ad7f1bf 100644 --- a/externals/grill/py/py.vcproj +++ b/externals/grill/py/py.vcproj @@ -85,7 +85,7 @@ = 2.1. +It has been thoroughly tested with versions 2.2 to 2.4 + +---------------------------------------------------------------------------- + +Goals/features of the package: + +Access the flexibility of the python language in PD and MaxMSP + + +PD - Load it as i library with e.g. "pd -lib py -path scripts" + + + +Check out the sample patches and scripts + + +Description: + +With the py object you can load python modules and execute the functions therein. +With the pyext you can use python classes to represent full-featured pd/Max message objects. +Multithreading (detached methods) is supported for both objects. +You can send messages to named objects or receive (with pyext) with Python methods. + + +Known bugs: +- The TCL/TK help patch is not usable under OSX. +- With standard PD 0.37, threaded py scripts will cause "Stack overflows" under some circumstances + -> use PD 0.38 or the devel_0_37 cvs branch instead +- It has been reported that pyext crashes on AMD64 with SSE enabled (for these CPUs, disable the respective compiler flags) + +---------------------------------------------------------------------------- + BUILDING from source -------------------- @@ -51,39 +90,6 @@ to avoid a compile-time type definition clash. ---------------------------------------------------------------------------- -Goals/features of the package: - -Access the flexibility of the python language in PD and MaxMSP - - -PD - Load it as i library with e.g. "pd -lib py -path scripts" - - - -Check out the sample patches and scripts - - -Description: - -With the py object you can load python modules and execute the functions therein. -With the pyext you can use python classes to represent full-featured pd/Max message objects. -Multithreading (detached methods) is supported for both objects. -You can send messages to named objects or receive (with pyext) with Python methods. - - -Known bugs: -- The TCL/TK help patch is not usable under OSX. -- With standard PD 0.37, threaded py scripts will cause "Stack overflows" under some circumstances - -> use PD 0.38 or the devel_0_37 cvs branch instead -- It has been reported that pyext crashes on AMD64 with SSE enabled (for these CPUs, disable the respective compiler flags) - ----------------------------------------------------------------------------- - -The py/pyext package should run with Python version >= 2.1. -It has been thoroughly tested with versions 2.2 to 2.4 - ----------------------------------------------------------------------------- - Version history: 0.2.1: diff --git a/externals/grill/py/source/pyext.cpp b/externals/grill/py/source/pyext.cpp index 91be31e0..b3cafb8a 100644 --- a/externals/grill/py/source/pyext.cpp +++ b/externals/grill/py/source/pyext.cpp @@ -251,9 +251,12 @@ bool pyext::DoInit() if(init) { if(PyMethod_Check(init)) { PyObject *res = PyObject_CallObject(init,pargs); - if(!res) + if(!res) { // exception is set ok = false; + // we want to know why __init__ failed... + PyErr_Print(); + } else Py_DECREF(res); } @@ -281,10 +284,8 @@ void pyext::DoExit() PyObject *ret = PyObject_CallObject(objdel,NULL); if(ret) Py_DECREF(ret); -#ifdef FLEXT_DEBUG - else - post("%s - Could not call _del method",thisName()); -#endif + else + PyErr_Print(); Py_DECREF(objdel); } else -- cgit v1.2.1