Handle that 'print' statements may fail in a release build.

git-svn-id: svn://10.0.0.236/trunk@199090 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2006-06-06 07:05:44 +00:00
parent bf094d6529
commit 5fbe3ce3e4

View File

@@ -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