Update of /cvsroot/pure-data/externals/grill/py/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21530/source
Modified Files: pybuffer.cpp Log Message: fixing numpy initialization quirks
Index: pybuffer.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/pybuffer.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pybuffer.cpp 20 Jan 2007 14:27:22 -0000 1.11 --- pybuffer.cpp 10 Feb 2007 03:20:57 -0000 1.12 *************** *** 3,7 **** py/pyext - python script object for PD and Max/MSP
! Copyright (c)2002-2006 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. --- 3,7 ---- py/pyext - python script object for PD and Max/MSP
! Copyright (c)2002-2007 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. *************** *** 762,775 **** };
! void initsamplebuffer() { - PyErr_Clear(); - - #ifdef PY_ARRAYS #ifdef PY_NUMARRAY import_libnumarray(); #else ! import_array(); #endif if(PyErr_Occurred()) // catch import error --- 762,780 ---- };
! // Must have this as a function because the import_array macro in numpy version 1.01 strangely has a return statement included. ! // Furthermore the import error printout from this macro is ugly, but we accept that for more, waiting for later numpy updates to fix all of this. ! static void __import_array__() { #ifdef PY_NUMARRAY import_libnumarray(); #else ! import_array(); #endif + } + + void initsamplebuffer() + { + #ifdef PY_ARRAYS + __import_array__(); if(PyErr_Occurred()) // catch import error