diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/libs/xpcom18a4/python/server | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/libs/xpcom18a4/python/server')
-rw-r--r-- | src/libs/xpcom18a4/python/server/loader.py | 14 |
1 files changed, 9 insertions, 5 deletions
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): |