diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2016-08-29 22:34:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-29 22:34:47 -0700 |
commit | 8ab47537c758fddb8d8eb8eff481a092e52cd793 (patch) | |
tree | 5a6defe08af0499febc1789c6064b1bacb8f6a24 /lib | |
parent | cf11c32720c6fa409468cd561666aaf002d3e37d (diff) | |
download | spack-8ab47537c758fddb8d8eb8eff481a092e52cd793.tar.gz spack-8ab47537c758fddb8d8eb8eff481a092e52cd793.tar.bz2 spack-8ab47537c758fddb8d8eb8eff481a092e52cd793.tar.xz spack-8ab47537c758fddb8d8eb8eff481a092e52cd793.zip |
Fix exception constructors. (#1663)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/provider_index.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/spack/spack/provider_index.py b/lib/spack/spack/provider_index.py index 3f9cd285e7..2be48b43c1 100644 --- a/lib/spack/spack/provider_index.py +++ b/lib/spack/spack/provider_index.py @@ -32,6 +32,7 @@ import yaml from yaml.error import MarkedYAMLError import spack +import spack.error class ProviderIndex(object): @@ -201,11 +202,10 @@ class ProviderIndex(object): "error parsing YAML ProviderIndex cache:", str(e)) if not isinstance(yfile, dict): - raise spack.spec.SpackYAMLError( - "YAML ProviderIndex was not a dict.") + raise ProviderIndexError("YAML ProviderIndex was not a dict.") if 'provider_index' not in yfile: - raise spack.spec.SpackYAMLError( + raise ProviderIndexError( "YAML ProviderIndex does not start with 'provider_index'") index = ProviderIndex() @@ -291,3 +291,7 @@ def _transform(providers, transform_fun, out_mapping_type=dict): (name, out_mapping_type([ transform_fun(vpkg, pset) for vpkg, pset in mapiter(mappings)])) for name, mappings in providers.items()) + + +class ProviderIndexError(spack.error.SpackError): + """Raised when there is a problem with a ProviderIndex.""" |