Stop showing colon after exception type when there is no message

This commit is contained in:
jack1142 2021-04-10 14:23:10 +02:00 committed by GitHub
parent 7b17bff680
commit 73ad8ef1f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -444,11 +444,13 @@ class Traceback:
(f"{stack.exc_type}: ", "traceback.exc_type"),
highlighter(stack.syntax_error.msg),
)
else:
elif stack.exc_value:
yield Text.assemble(
(f"{stack.exc_type}: ", "traceback.exc_type"),
highlighter(stack.exc_value),
)
else:
yield Text.assemble((f"{stack.exc_type}", "traceback.exc_type"))
if not last:
if stack.is_cause: