VirtualBox

Ignore:
Timestamp:
Mar 6, 2014 1:08:28 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92674
Message:

pyxpcom: Support new style python classes (derived from object), upstream changeset b6fce9508c70 (http://hg.mozilla.org/pyxpcom/rev/b6fce9508c70).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/server/loader.py

    r11746 r50710  
    5858    comps = []
    5959    for name, object in py_module.__dict__.items():
    60         if type(object)==types.ClassType and \
    61            _has_good_attr(object, "_com_interfaces_") and \
    62            _has_good_attr(object, "_reg_clsid_") and \
    63            _has_good_attr(object, "_reg_contractid_"):
    64             comps.append(object)
     60        try:
     61            if (type(object) == types.ClassType or issubclass(object, object)) and \
     62               _has_good_attr(object, "_com_interfaces_") and \
     63               _has_good_attr(object, "_reg_clsid_") and \
     64               _has_good_attr(object, "_reg_contractid_"):
     65                comps.append(object)
     66        except TypeError:
     67            # The issubclass call raises TypeError when the obj is not a class.
     68            pass;
    6569    return comps
    6670
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette