diff options
Diffstat (limited to 'bindings/lang_python.py')
| -rw-r--r-- | bindings/lang_python.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bindings/lang_python.py b/bindings/lang_python.py index 16ee7996..de31fd09 100644 --- a/bindings/lang_python.py +++ b/bindings/lang_python.py @@ -459,8 +459,12 @@ register_constants(PyObject *d) print >> fd, ' this->%s = g_strdup(value);' % m[1] elif parse_format == 'O' and arg_type == 'GList*': elem_type = m[2].get('elem_type') - # XXX: raise appropriate exception (TypeError) - print >> fd, ' if (!PyTuple_Check(cvt_value)) return NULL;' + print >> fd, '''\ + if (!PyTuple_Check(cvt_value)) { + PyErr_SetString(PyExc_TypeError, "value should be tuple"); + return NULL; + } +''' if elem_type == 'char*': print >> fd, '''\ if (this->%(v)s) { |
