aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/pyext.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-01-06 03:38:37 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-01-06 03:38:37 +0000
commit58e4d7bbbdebe1ee96b318873391b634ca3b8a8f (patch)
treeb872cc12cb79f7746c5fd5c0048188093c8b1755 /externals/grill/py/source/pyext.cpp
parent26bce99988ed7f18cef77ede2be92acd42ebb60c (diff)
""
svn path=/trunk/; revision=1250
Diffstat (limited to 'externals/grill/py/source/pyext.cpp')
-rw-r--r--externals/grill/py/source/pyext.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/externals/grill/py/source/pyext.cpp b/externals/grill/py/source/pyext.cpp
index b8763771..799de20a 100644
--- a/externals/grill/py/source/pyext.cpp
+++ b/externals/grill/py/source/pyext.cpp
@@ -2,7 +2,7 @@
py/pyext - python script object for PD and MaxMSP
-Copyright (c) 2002-2003 Thomas Grill (xovo@gmx.net)
+Copyright (c) 2002-2004 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
@@ -339,10 +339,19 @@ void pyext::m_set(int argc,const t_atom *argv)
post("%s - set: Python variable %s not found",thisName(),ch);
}
else {
- PyObject *pval = MakePyArgs(sym_list,AtomList(argc-1,argv+1),-1,false);
- if(!pval)
+ PyObject *pval = MakePyArgs(NULL,AtomList(argc-1,argv+1),-1,false);
+
+ if(!pval)
PyErr_Print();
else {
+ if(PySequence_Size(pval) == 1) {
+ // reduce lists of one element to element itself
+
+ PyObject *val1 = PySequence_GetItem(pval,0);
+ Py_DECREF(pval);
+ pval = val1;
+ }
+
PyObject_SetAttrString(pyobj,ch,pval);
Py_DECREF(pval);
}