improves exception output
This commit is contained in:
parent
2a2a26977a
commit
d2c41b6670
1 changed files with 7 additions and 4 deletions
|
@ -753,12 +753,15 @@ class Main:
|
|||
# otherwise give up
|
||||
else:
|
||||
method = None
|
||||
method_display_name = "<y>%s<.>" %(method_name)
|
||||
method_display_name = ""
|
||||
|
||||
if method_name == "<module>":
|
||||
method_type = "module"
|
||||
elif method_name == "<genexpr>":
|
||||
method_type = "a generator expression"
|
||||
else:
|
||||
method_type = "<r>unknown callable<.>"
|
||||
method_display_name = " <y>%s<.>" %(method_name)
|
||||
|
||||
# use a docstring-provided action description if available
|
||||
if method and method.__doc__ and "@while" in method.__doc__:
|
||||
|
@ -766,7 +769,7 @@ class Main:
|
|||
else:
|
||||
action = ""
|
||||
|
||||
tb_lines.append("%sin %s <y>%s<.> at %s:%d," %(action, method_type, method_display_name, frame.f_code.co_filename, frame.f_lineno))
|
||||
tb_lines.append("%sin %s%s at %s:%d," %(action, method_type, method_display_name, frame.f_code.co_filename, frame.f_lineno))
|
||||
|
||||
if hasattr(exception, "description"):
|
||||
reason = ": <R>%s<.>" %(exception.description)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue