зеркало из https://github.com/mozilla/pjs.git
Handle that 'print' statements may fail in a release build.
This commit is contained in:
Родитель
0b69ffe1e1
Коммит
a56b040b5a
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче