VideoTexture: exception in C++ was not returning an error in Python. Added function name ini PyArg_ParseTuple.

This commit is contained in:
Benoit Bolsee
2009-05-24 23:12:38 +00:00
parent 4e0e720158
commit 323052068a
6 changed files with 21 additions and 13 deletions

View File

@@ -109,7 +109,9 @@ PyObject * getWeight (PyImage * self, PyObject * args)
short weight = 0;
// get arguments
char * id;
if (self->m_image != NULL && PyArg_ParseTuple(args, "s", &id))
if (!PyArg_ParseTuple(args, "s:getWeight", &id))
return NULL;
if (self->m_image != NULL)
// get weight
weight = getImageMix(self)->getWeight(id);
// return weight
@@ -123,7 +125,9 @@ PyObject * setWeight (PyImage * self, PyObject * args)
// get arguments
char * id;
short weight = 0;
if (self->m_image != NULL && PyArg_ParseTuple(args, "sh", &id, &weight))
if (!PyArg_ParseTuple(args, "sh:setWeight", &id, &weight))
return NULL;
if (self->m_image != NULL)
// set weight
if (!getImageMix(self)->setWeight(id, weight))
{