diff options
| author | Christopher Aillon <caillon@redhat.com> | 2005-08-12 19:25:13 +0000 |
|---|---|---|
| committer | Christopher Aillon <caillon@src.gnome.org> | 2005-08-12 19:25:13 +0000 |
| commit | d9b0169ad2b312d0776b3a2a03d93e8d91049f75 (patch) | |
| tree | f4b9ecd2ba4539749caa4def0939b0ec3cb5c133 | |
| parent | 51e369e936e48289e73626060a908c6b4233d568 (diff) | |
| download | pygobject-d9b0169ad2b312d0776b3a2a03d93e8d91049f75.tar.gz pygobject-d9b0169ad2b312d0776b3a2a03d93e8d91049f75.tar.xz pygobject-d9b0169ad2b312d0776b3a2a03d93e8d91049f75.zip | |
pyg_flags_get_value () should accept longs as input
2005-08-12 Christopher Aillon <caillon@redhat.com>
* gobject/pygtype.c:
pyg_flags_get_value () should accept longs as input
| -rw-r--r-- | gobject/pygtype.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c index 827c8a5..9b4dcda 100644 --- a/gobject/pygtype.c +++ b/gobject/pygtype.c @@ -480,6 +480,9 @@ pyg_flags_get_value(GType flag_type, PyObject *obj, gint *val) } else if (PyInt_Check(obj)) { *val = PyInt_AsLong(obj); res = 0; + } else if (PyLong_Check(obj)) { + *val = PyLong_AsLongLong(obj); + res = 0; } else if (PyString_Check(obj)) { GFlagsValue *info; char *str = PyString_AsString(obj); @@ -534,7 +537,7 @@ pyg_flags_get_value(GType flag_type, PyObject *obj, gint *val) g_type_class_unref(fclass); } else { PyErr_SetString(PyExc_TypeError, - "flag values must be strings, ints or tuples"); + "flag values must be strings, ints, longs, or tuples"); res = -1; } return res; |
