Fix color bug in Spec.format() introduced by #3013
This commit is contained in:
parent
b88f55e523
commit
44ce0adbd5
@ -2706,11 +2706,8 @@ def format(self, format_string='$_$@$%@+$+$=', **kwargs):
|
|||||||
named_str = fmt = ''
|
named_str = fmt = ''
|
||||||
|
|
||||||
def write(s, c):
|
def write(s, c):
|
||||||
if color:
|
f = color_formats[c] + cescape(s) + '@.'
|
||||||
f = color_formats[c] + cescape(s) + '@.'
|
cwrite(f, stream=out, color=color)
|
||||||
cwrite(f, stream=out, color=color)
|
|
||||||
else:
|
|
||||||
out.write(s)
|
|
||||||
|
|
||||||
iterator = enumerate(format_string)
|
iterator = enumerate(format_string)
|
||||||
for i, c in iterator:
|
for i, c in iterator:
|
||||||
@ -2802,7 +2799,7 @@ def write(s, c):
|
|||||||
write(fmt % str(self.variants), '+')
|
write(fmt % str(self.variants), '+')
|
||||||
elif named_str == 'ARCHITECTURE':
|
elif named_str == 'ARCHITECTURE':
|
||||||
if self.architecture and str(self.architecture):
|
if self.architecture and str(self.architecture):
|
||||||
write(fmt % str(self.architecture), ' arch=')
|
write(fmt % str(self.architecture), '=')
|
||||||
elif named_str == 'SHA1':
|
elif named_str == 'SHA1':
|
||||||
if self.dependencies:
|
if self.dependencies:
|
||||||
out.write(fmt % str(self.dag_hash(7)))
|
out.write(fmt % str(self.dag_hash(7)))
|
||||||
|
Loading…
Reference in New Issue
Block a user