From fe350ea557cec0d9f2b9e9c6c88dd9633cd2e879 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Fleuret?= Date: Thu, 8 Dec 2022 17:30:52 +0100 Subject: [PATCH] Now also catch ValueError. --- tensorstack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorstack.py b/tensorstack.py index 8360f9b..d7b0d89 100755 --- a/tensorstack.py +++ b/tensorstack.py @@ -27,7 +27,7 @@ def exception_hook(exc_type, exc_value, tb): print(f' File "{filename}", line {line_no}, in {name}') print(open(filename, 'r').readlines()[line_no-1]) - if exc_type is RuntimeError: + if exc_type in { RuntimeError, ValueError }: for n,v in tb.tb_frame.f_locals.items(): print(f' {n} -> {v}') -- 2.39.5