[pygobject] Use hasattr when testing for __info__ when finding vfuncs
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Use hasattr when testing for __info__ when finding vfuncs
- Date: Wed, 7 Nov 2012 11:54:26 +0000 (UTC)
commit 21076d4b8f3ec8e253ca236fa3b20b07fde237fe
Author: Simon Feltman <sfeltman src gnome org>
Date: Wed Nov 7 03:49:24 2012 -0800
Use hasattr when testing for __info__ when finding vfuncs
Change gi.types.find_vfunc_info_in_interface to use hasattr
when finding vfuncs. Using '__info__' in __dict__ was skipping
overridden interfaces which don't directly contain the __info__.
gi/types.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gi/types.py b/gi/types.py
index fb4b5f8..af3310a 100644
--- a/gi/types.py
+++ b/gi/types.py
@@ -191,7 +191,7 @@ def find_vfunc_info_in_interface(bases, vfunc_name):
# Skip bases without __info__ (static _gobject._gobject.GObject)
if base is GInterface or\
not issubclass(base, GInterface) or\
- not '__info__' in base.__dict__ or\
+ not hasattr(base, '__info__') or\
not isinstance(base.__info__, InterfaceInfo):
continue
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]