From d9b0169ad2b312d0776b3a2a03d93e8d91049f75 Mon Sep 17 00:00:00 2001 From: Christopher Aillon Date: Fri, 12 Aug 2005 19:25:13 +0000 Subject: pyg_flags_get_value () should accept longs as input 2005-08-12 Christopher Aillon * gobject/pygtype.c: pyg_flags_get_value () should accept longs as input --- gobject/pygtype.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gobject') 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; -- cgit