summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2005-03-15 20:40:38 +0000
committerJohan Dahlin <johan@src.gnome.org>2005-03-15 20:40:38 +0000
commit989f5704b31a98f0eaff060563ae4ba1bb63d7e0 (patch)
tree6f56cf856c8c1566c21a9702c292ad85f9b56b24 /codegen
parent6e70ba554cd0556f405450fa0c2bba45363815f0 (diff)
downloadpygtk-989f5704b31a98f0eaff060563ae4ba1bb63d7e0.tar.gz
Check arguments if we have no arguments. Fixes bug #170266 (Doug Quale)
* codegen/codegen.py: Check arguments if we have no arguments. Fixes bug #170266 (Doug Quale)
Diffstat (limited to 'codegen')
-rw-r--r--codegen/codegen.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/codegen/codegen.py b/codegen/codegen.py
index 3afd3d59..6aaa855c 100644
--- a/codegen/codegen.py
+++ b/codegen/codegen.py
@@ -789,12 +789,16 @@ class GObjectWrapper(Wrapper):
print >> out, " for (i = 0; i < nparams; ++i)"
print >> out, " g_value_unset(&params[i].value);"
else:
+ print >> out, " static char* kwlist[] = { NULL };";
print >> out
if constructor.deprecated is not None:
print >> out, ' if (PyErr_Warn(PyExc_DeprecationWarning, "%s") < 0)' %\
constructor.deprecated
print >> out, ' return -1;'
print >> out
+ print >> out, ' if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":%s.__init__", kwlist))' % classname
+ print >> out, " return -1;"
+ print >> out
print >> out, " self->obj = g_object_newv(obj_type, 0, NULL);"
print >> out, \