From c5b677848794c9331115d89d28aaea6723948e5b Mon Sep 17 00:00:00 2001 From: LiangShe Date: Thu, 13 Jul 2017 20:15:07 -0700 Subject: [PATCH] unpack result._traceback without assuming its size Resolve ValueError: too many values to unpack issue #53 #56 from original repo --- prettytensor/pretty_tensor_class.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prettytensor/pretty_tensor_class.py b/prettytensor/pretty_tensor_class.py index a96c693..d701cec 100644 --- a/prettytensor/pretty_tensor_class.py +++ b/prettytensor/pretty_tensor_class.py @@ -1332,7 +1332,8 @@ def _strip_unnecessary_contents_from_stack(result, processed): processed.add(result) trace = [] found = False - for f, line_no, method, _ in result._traceback: + for trace_content in result._traceback: + f, line_no, method = trace_content[0:3] if (method in ('_replace_deferred', '_construct') and f.endswith('pretty_tensor_class.py')): found = True