VirtualBox

Ignore:
Timestamp:
Feb 24, 2016 9:13:27 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105674
Message:

temporarily back out the recent Python 3 changes (r105649, r105645, r105644, r105643, r105641)

File:
1 edited

Legend:

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

    r59769 r59795  
    3838import xpcom
    3939from xpcom import components, logger
    40 from . import module
    41 import glob
    42 import os
     40
     41import module
     42
     43import glob, os, types
     44
    4345from xpcom.client import Component
    4446
     
    5557    # For now, just run over all classes looking for likely candidates.
    5658    comps = []
    57     for name, object in list(py_module.__dict__.items()):
     59    for name, object in py_module.__dict__.items():
    5860        try:
    59             if (type(object) == type or issubclass(object, object)) and \
     61            if (type(object) == types.ClassType or issubclass(object, object)) and \
    6062               _has_good_attr(object, "_com_interfaces_") and \
    6163               _has_good_attr(object, "_reg_clsid_") and \
     
    146148                    self.autoRegisterComponent(when, entry)
    147149                # Handle some common user errors
    148                 except xpcom.COMException as details:
     150                except xpcom.COMException, details:
    149151                    from xpcom import nsError
    150152                    # If the interface name does not exist, suppress the traceback
     
    154156                    else:
    155157                        logger.exception("Registration of '%s' failed!", entry.leafName)
    156                 except SyntaxError as details:
     158                except SyntaxError, details:
    157159                    # Syntax error in source file - no useful traceback here either.
    158160                    logger.error("Registration of '%s' failed\n %s",
     
    224226
    225227def MakePythonComponentLoaderModule(serviceManager, nsIFile):
    226     from . import module
     228    import module
    227229    return module.Module( [PythonComponentLoader] )
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