Avoid raising an exception within an except clause that will re-raise

git-svn-id: http://svn.pyinstaller.org/trunk@816 8dd32b29-ccff-0310-8a9a-9233e24343b1
This commit is contained in:
giovannibajo
2010-03-31 22:08:12 +00:00
parent 85dbe1b806
commit b5cec0fc09
+4 -7
View File
@@ -528,13 +528,10 @@ class ImportManager:
# Should we save the mod dict and restore it in case
# of failure?
if not reload:
try:
del sys.modules[fqname]
except KeyError:
# Some modules (eg: dbhash.py) cleanup
# sys.modules themselves. We should then
# be lenient and avoid errors.
pass
# Some modules (eg: dbhash.py) cleanup
# sys.modules themselves. We should then
# be lenient and avoid errors.
sys.modules.pop(fqname, None)
if hasattr(parent, nm):
delattr(parent, nm)
raise