summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/repo.py3
-rw-r--r--lib/spack/spack/solver/asp.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py
index 484034bb06..5e1457c165 100644
--- a/lib/spack/spack/repo.py
+++ b/lib/spack/spack/repo.py
@@ -681,6 +681,9 @@ class RepoPath(object):
def is_virtual(self, pkg_name):
"""True if the package with this name is virtual, False otherwise."""
+ if not isinstance(pkg_name, str):
+ raise ValueError(
+ "is_virtual(): expected package name, got %s" % type(pkg_name))
return pkg_name in self.provider_index
def __contains__(self, pkg_name):
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 6952126921..f1d2b40b60 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -189,7 +189,7 @@ def check_packages_exist(specs):
repo = spack.repo.path
for spec in specs:
for s in spec.traverse():
- if not (repo.exists(s.name) or repo.is_virtual(s)):
+ if not (repo.exists(s.name) or repo.is_virtual(s.name)):
raise spack.repo.UnknownPackageError(s.name)