From fb123f93f9f5ce42c8e5785d2f8e0edaf951740e Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 26 Mar 2014 19:21:20 +0000 Subject: Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2. --- src/libs/xpcom18a4/python/server/loader.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/libs/xpcom18a4/python/server/loader.py') diff --git a/src/libs/xpcom18a4/python/server/loader.py b/src/libs/xpcom18a4/python/server/loader.py index b5875546..e59155a5 100644 --- a/src/libs/xpcom18a4/python/server/loader.py +++ b/src/libs/xpcom18a4/python/server/loader.py @@ -57,11 +57,15 @@ def FindCOMComponents(py_module): # For now, just run over all classes looking for likely candidates. comps = [] for name, object in py_module.__dict__.items(): - if type(object)==types.ClassType and \ - _has_good_attr(object, "_com_interfaces_") and \ - _has_good_attr(object, "_reg_clsid_") and \ - _has_good_attr(object, "_reg_contractid_"): - comps.append(object) + try: + if (type(object) == types.ClassType or issubclass(object, object)) and \ + _has_good_attr(object, "_com_interfaces_") and \ + _has_good_attr(object, "_reg_clsid_") and \ + _has_good_attr(object, "_reg_contractid_"): + comps.append(object) + except TypeError: + # The issubclass call raises TypeError when the obj is not a class. + pass; return comps def register_self(klass, compMgr, location, registryLocation, componentType): -- cgit v1.2.1