diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2015-02-18 16:45:54 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2015-02-18 16:45:54 -0800 |
commit | 02e316e7724e8f39e69306f03bcbff1eaa12827c (patch) | |
tree | e03b38eeeefa280a0a8a675a8e12e5847f45e576 /lib | |
parent | 2374eb4dca2a3bb4db5586251964d5ca9166b45a (diff) | |
download | spack-02e316e7724e8f39e69306f03bcbff1eaa12827c.tar.gz spack-02e316e7724e8f39e69306f03bcbff1eaa12827c.tar.bz2 spack-02e316e7724e8f39e69306f03bcbff1eaa12827c.tar.xz spack-02e316e7724e8f39e69306f03bcbff1eaa12827c.zip |
Convert ValueErrors to SpackError subclass.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/package.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 492af12053..fed62f6cb7 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -941,16 +941,17 @@ class Package(object): def _sanity_check_extension(self): if not self.is_extension: - raise ValueError("This package is not an extension.") + raise ActivationError("This package is not an extension.") + extendee_package = self.extendee_spec.package extendee_package._check_extendable() if not extendee_package.installed: - raise ValueError("Can only (de)activate extensions for installed packages.") + raise ActivationError("Can only (de)activate extensions for installed packages.") if not self.installed: - raise ValueError("Extensions must first be installed.") + raise ActivationError("Extensions must first be installed.") if not self.extendee_spec.name in self.extendees: - raise ValueError("%s does not extend %s!" % (self.name, self.extendee.name)) + raise ActivationError("%s does not extend %s!" % (self.name, self.extendee.name)) def do_activate(self, **kwargs): |