Commit 8b02cffd authored by Tom Niget's avatar Tom Niget

Allow manually specifying the node for traceback

parent fa71cb36
...@@ -42,6 +42,9 @@ def exception_hook(exc_type, exc_value, tb): ...@@ -42,6 +42,9 @@ def exception_hook(exc_type, exc_value, tb):
if name == "visit" and (node := local_vars["node"]) and isinstance(node, ast.AST): if name == "visit" and (node := local_vars["node"]) and isinstance(node, ast.AST):
last_node = node last_node = node
if node := local_vars.get("TB_NODE", None):
last_node = node
if local_vars.get("TB_SKIP", None) and tb.tb_next: if local_vars.get("TB_SKIP", None) and tb.tb_next:
tb = tb.tb_next tb = tb.tb_next
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment