diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-10-02 16:42:13 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2005-10-02 16:42:13 +0000 |
commit | ff2284456bc37edb7045f032245fdcb278bf632d (patch) | |
tree | 076c7d1cb9d85debde5d6a8766d0384773e189bd /gobject/pygtype.c | |
parent | cf917a58a5c92a4e0d230e1e24b81b730decbb4e (diff) | |
download | pygobject-ff2284456bc37edb7045f032245fdcb278bf632d.tar.gz |
guint64 property fix
Diffstat (limited to 'gobject/pygtype.c')
-rw-r--r-- | gobject/pygtype.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c index 9b4dcda6..ebb9dd8c 100644 --- a/gobject/pygtype.c +++ b/gobject/pygtype.c @@ -95,7 +95,7 @@ _wrap_g_type_wrapper__get_fundamental(PyGTypeWrapper *self, void *closure) static PyObject * _wrap_g_type_wrapper__get_children(PyGTypeWrapper *self, void *closure) { - int n_children, i; + guint n_children, i; GType *children; PyObject *retval; @@ -112,7 +112,7 @@ _wrap_g_type_wrapper__get_children(PyGTypeWrapper *self, void *closure) static PyObject * _wrap_g_type_wrapper__get_interfaces(PyGTypeWrapper *self, void *closure) { - int n_interfaces, i; + guint n_interfaces, i; GType *interfaces; PyObject *retval; @@ -774,12 +774,12 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) } break; case G_TYPE_UINT64: - g_value_set_uint64(value, PyLong_AsUnsignedLongLong(obj)); - if (PyErr_Occurred()) { - g_value_unset(value); - PyErr_Clear(); - return -1; - } + if (PyInt_Check(obj)) + g_value_set_uint64(value, PyInt_AsLong(obj)); + else if (PyLong_Check(obj)) + g_value_set_uint64(value, PyLong_AsUnsignedLongLong(obj)); + else + return -1; break; case G_TYPE_ENUM: { @@ -793,7 +793,7 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj) break; case G_TYPE_FLAGS: { - guint val = 0; + gint val = 0; if (pyg_flags_get_value(G_VALUE_TYPE(value), obj, &val) < 0) { PyErr_Clear(); return -1; |