Fix ambiguous hash message generation. (#2940)
* Fix ambiguous hash message generation. Engineering fix
This commit is contained in:
parent
aa7c5d1115
commit
58a4c5c14d
1 changed files with 4 additions and 4 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue