Merge pull request #904 from TheCakeIsNaOH/hints-string

This commit is contained in:
Nick Sweeting 2021-12-17 16:53:36 -05:00 committed by GitHub
commit e3d4d0aa91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -432,7 +432,10 @@ def log_archive_method_finished(result: "ArchiveResult"):
# Prettify error output hints string and limit to five lines
hints = getattr(result.output, 'hints', None) or ()
if hints:
hints = hints if isinstance(hints, (list, tuple)) else hints.split('\n')
if not isinstance(hints, (list, tuple)):
if isinstance(hints, bytes):
hints = hints.decode()
hints = hints.split('\n')
hints = (
' {}{}{}'.format(ANSI['lightyellow'], line.strip(), ANSI['reset'])
for line in hints[:5] if line.strip()