VirtualBox

Ignore:
Timestamp:
Feb 22, 2016 12:14:21 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105641
Message:

PyXPCOM: port to make it compatible with Python 3 (minimum supported version is 2.6 like for all other Python files now)
Frontends/VBoxShell, Installer/common/vboxapisetup.py, Main/glue/vboxapi.py, Main/webservice/websrv-python.xsl: make it compatible with Python 3

File:
1 edited

Legend:

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

    r11746 r59769  
    3939from xpcom import nsError
    4040
    41 import factory
     41from . import factory
    4242
    4343import types
     
    6666        # void function.
    6767        fname = os.path.basename(location.path)
    68         for klass in self.components.values():
     68        for klass in list(self.components.values()):
    6969            reg_contractid = klass._reg_contractid_
    70             print "Registering '%s' (%s)" % (reg_contractid, fname)
     70            print("Registering '%s' (%s)" % (reg_contractid, fname))
    7171            reg_desc = getattr(klass, "_reg_desc_", reg_contractid)
    7272            compMgr = compMgr.queryInterface(components.interfaces.nsIComponentRegistrar)
     
    8585    def unregisterSelf(self, compMgr, location, loaderStr):
    8686        # void function.
    87         for klass in self.components.values():
     87        for klass in list(self.components.values()):
    8888            ok = 1
    8989            try:
     
    9999                    ok = 0
    100100            if ok:
    101                 print "Successfully unregistered", klass.__name__
     101                print("Successfully unregistered", klass.__name__)
    102102            else:
    103                 print "Unregistration of", klass.__name__, "failed. (probably just not already registered)"
     103                print("Unregistration of", klass.__name__, "failed. (probably just not already registered)")
    104104       
    105105    def canUnload(self, compMgr):
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