diff --git a/extensions/python/xpcom/server/module.py b/extensions/python/xpcom/server/module.py index 73318f5b971..1900d64009d 100644 --- a/extensions/python/xpcom/server/module.py +++ b/extensions/python/xpcom/server/module.py @@ -67,7 +67,10 @@ class Module: fname = os.path.basename(location.path) for klass in self.components.values(): reg_contractid = klass._reg_contractid_ - print "Registering '%s' (%s)" % (reg_contractid, fname) + try: + print "Registering '%s' (%s)" % (reg_contractid, fname) + except IOError: + pass # stdout may not be valid for windows apps! reg_desc = getattr(klass, "_reg_desc_", reg_contractid) compMgr = compMgr.queryInterface(components.interfaces.nsIComponentRegistrar) compMgr.registerFactoryLocation(klass._reg_clsid_, @@ -97,10 +100,13 @@ class Module: extra_func(klass, compMgr, location, loaderStr) except Exception: ok = 0 - if ok: - print "Successfully unregistered", klass.__name__ - else: - print "Unregistration of", klass.__name__, "failed (not previously registered?)" + try: + if ok: + print "Successfully unregistered", klass.__name__ + else: + print "Unregistration of", klass.__name__, "failed (not previously registered?)" + except IOError: + pass def canUnload(self, compMgr): # single bool result