aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/clmeth.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-07-15 16:13:43 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-07-15 16:13:43 +0000
commitad9d49bf213f525d122656fc7dc55287b9ae00f0 (patch)
treedab21d5be62c5c96a862278e15932c3aabb3c0a8 /externals/grill/py/source/clmeth.cpp
parent0ba6ec4c3bca4a58f287ecaa50ee116f268459ea (diff)
None returned by script will bang the output
fixes for atomic pyext._outlet messages svn path=/trunk/; revision=3346
Diffstat (limited to 'externals/grill/py/source/clmeth.cpp')
-rw-r--r--externals/grill/py/source/clmeth.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/externals/grill/py/source/clmeth.cpp b/externals/grill/py/source/clmeth.cpp
index 37ba257e..3d740bcb 100644
--- a/externals/grill/py/source/clmeth.cpp
+++ b/externals/grill/py/source/clmeth.cpp
@@ -167,15 +167,26 @@ PyObject *pyext::pyext_outlet(PyObject *,PyObject *args)
pyext *ext = GetThis(self);
PyObject *val;
-
- bool tp =
- sz == 3 &&
- PySequence_Check(
- val = PyTuple_GET_ITEM(args,2) // borrow reference
- );
+ bool tp;
+#if 0
+ if(sz == 3) {
+ val = PyTuple_GET_ITEM(args,2); // borrow reference
+ Py_INCREF(val);
+ tp = PySequence_Check(val);
+ }
+ else
+ tp = false;
if(!tp)
- val = PySequence_GetSlice(args,2,sz); // new ref
+ val = PySequence_GetSlice(args,2,sz); // new ref
+#else
+ if(sz == 3) {
+ val = PyTuple_GET_ITEM(args,2); // borrow reference
+ Py_INCREF(val);
+ }
+ else
+ val = PySequence_GetSlice(args,2,sz); // new ref
+#endif
int o = PyInt_AsLong(outl);
if(o >= 1 && o <= ext->Outlets()) {
@@ -190,7 +201,7 @@ PyObject *pyext::pyext_outlet(PyObject *,PyObject *args)
else
PyErr_SetString(PyExc_ValueError,"pyext - _outlet: index out of range");
- if(!tp) Py_DECREF(val);
+ Py_DECREF(val);
}
else
PyErr_SetString(PyExc_SyntaxError,"pyext - Syntax: _outlet(self,outlet,args...)");