diff options
Diffstat (limited to 'lib/spack/spack/solver/asp.py')
-rw-r--r-- | lib/spack/spack/solver/asp.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 09a03543f8..a6c375ab17 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -808,7 +808,7 @@ class SpackSolverSetup(object): self.gen.fact(fn.condition(condition_id)) # requirements trigger the condition - requirements = self.checked_spec_clauses( + requirements = self.spec_clauses( named_cond, body=True, required_from=name) for pred in requirements: self.gen.fact( @@ -816,7 +816,7 @@ class SpackSolverSetup(object): ) if imposed_spec: - imposed_constraints = self.checked_spec_clauses( + imposed_constraints = self.spec_clauses( imposed_spec, body=False, required_from=name) for pred in imposed_constraints: # imposed "node"-like conditions are no-ops @@ -1006,13 +1006,13 @@ class SpackSolverSetup(object): self.gen.fact(fn.compiler_version_flag( compiler.name, compiler.version, name, flag)) - def checked_spec_clauses(self, *args, **kwargs): - """Wrap a call to spec clauses into a try/except block that raise - a comprehensible error message in case of failure. + def spec_clauses(self, *args, **kwargs): + """Wrap a call to `_spec_clauses()` into a try/except block that + raises a comprehensible error message in case of failure. """ requestor = kwargs.pop('required_from', None) try: - clauses = self.spec_clauses(*args, **kwargs) + clauses = self._spec_clauses(*args, **kwargs) except RuntimeError as exc: msg = str(exc) if requestor: @@ -1020,7 +1020,7 @@ class SpackSolverSetup(object): raise RuntimeError(msg) return clauses - def spec_clauses(self, spec, body=False, transitive=True): + def _spec_clauses(self, spec, body=False, transitive=True): """Return a list of clauses for a spec mandates are true. Arguments: @@ -1133,7 +1133,7 @@ class SpackSolverSetup(object): # add all clauses from dependencies if transitive: for dep in spec.traverse(root=False): - clauses.extend(self.spec_clauses(dep, body, transitive=False)) + clauses.extend(self._spec_clauses(dep, body, transitive=False)) return clauses |