Fix ambiguous hash message generation. (#2940)

* Fix ambiguous hash message generation. Engineering fix
This commit is contained in:
becker33 2017-01-27 11:37:21 -08:00 committed by Todd Gamblin
parent aa7c5d1115
commit 58a4c5c14d

View file

@ -2796,7 +2796,7 @@ def spec_by_hash(self):
if len(matches) != 1: if len(matches) != 1:
raise AmbiguousHashError( raise AmbiguousHashError(
"Multiple packages specify hash beginning %s." "Multiple packages specify hash beginning '%s'."
% self.token.value, *matches) % self.token.value, *matches)
return matches[0] return matches[0]
@ -3151,9 +3151,9 @@ def __init__(self, provided, required):
class AmbiguousHashError(SpecError): class AmbiguousHashError(SpecError):
def __init__(self, msg, *specs): def __init__(self, msg, *specs):
super(AmbiguousHashError, self).__init__(msg) specs_str = '\n ' + '\n '.join(spec.format('$.$@$%@+$+$=$#')
for spec in specs: for spec in specs)
print(' ', spec.format('$.$@$%@+$+$=$#')) super(AmbiguousHashError, self).__init__(msg + specs_str)
class InvalidHashError(SpecError): class InvalidHashError(SpecError):