diff options
author | Felix Geyer <fgeyer@debian.org> | 2014-04-05 22:17:15 +0200 |
---|---|---|
committer | Felix Geyer <fgeyer@debian.org> | 2014-04-05 22:17:15 +0200 |
commit | 1700c7d32f7d9d101cbba9f1fcb8bb57ed16a727 (patch) | |
tree | 727251ad65172262944f82bb0f28601c3fb6f6b3 /src/libs/xpcom18a4/python/server/loader.py | |
parent | 1e85aed889b772c2f2daa7a6d9e8bd967aa213d8 (diff) | |
download | virtualbox-upstream.tar.gz |
Imported Upstream version 4.3.10-dfsgupstream/4.3.10-dfsgupstream
Diffstat (limited to 'src/libs/xpcom18a4/python/server/loader.py')
-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 b58755461..e59155a51 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): |