[pygobject/gsoc2009: 152/160] Call _pygi_g_registered_type_info_check_object to check an enum
- From: Simon van der Linden <svdlinden src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject/gsoc2009: 152/160] Call _pygi_g_registered_type_info_check_object to check an enum
- Date: Fri, 14 Aug 2009 21:36:30 +0000 (UTC)
commit 21ba6cf4a28476539d65ae72960954a081ff146f
Author: Simon van der Linden <svdlinden src gnome org>
Date: Thu Aug 13 14:30:26 2009 +0200
Call _pygi_g_registered_type_info_check_object to check an enum
gi/pygi-argument.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index f44da8e..b1f6f6f 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -536,22 +536,7 @@ check_number_release:
switch (info_type) {
case GI_INFO_TYPE_ENUM:
{
- PyTypeObject *type;
-
- type = (PyTypeObject *)pygi_type_find_by_gi_info(info);
- if (type == NULL) {
- retval = -1;
- break;
- }
-
- if (!PyObject_TypeCheck(object, type)) {
- PyErr_Format(PyExc_TypeError, "Must be %s, not %s",
- type->tp_name, object->ob_type->tp_name);
- retval = 0;
- }
-
- Py_DECREF(type);
-
+ retval = _pygi_g_registered_type_info_check_object((GIRegisteredTypeInfo *)info, TRUE, object);
break;
}
case GI_INFO_TYPE_STRUCT:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]