Fix SPACK-17: Remove install prefix if install() fails
- except clause now catches anything, not just exception - sys.exit() changed to os._exit() to avoid interfering with unit tests and to avoid raising SystemExit exception when child processes quit.
This commit is contained in:
parent
15589754ec
commit
0c99d9ddc3
@ -674,15 +674,18 @@ def do_install(self):
|
|||||||
% self.name)
|
% self.name)
|
||||||
|
|
||||||
# On successful install, remove the stage.
|
# On successful install, remove the stage.
|
||||||
# Leave if if there is an error
|
# Leave if there is an error
|
||||||
self.stage.destroy()
|
self.stage.destroy()
|
||||||
|
|
||||||
tty.msg("Successfully installed %s" % self.name)
|
tty.msg("Successfully installed %s" % self.name)
|
||||||
print_pkg(self.prefix)
|
print_pkg(self.prefix)
|
||||||
|
|
||||||
sys.exit(0)
|
# Use os._exit here to avoid raising a SystemExit exception,
|
||||||
|
# which interferes with unit tests.
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
except Exception, e:
|
except:
|
||||||
|
# If anything else goes wrong, get rid of the install dir.
|
||||||
self.remove_prefix()
|
self.remove_prefix()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user