From c976a185bbdfabac3e6fc51a3fd2697c8777177d Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Sat, 11 May 2019 16:02:39 +0500 Subject: [PATCH] Join two lines in get_local_reprs --- pysnooper/tracer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pysnooper/tracer.py b/pysnooper/tracer.py index 459ae84..69db5ad 100644 --- a/pysnooper/tracer.py +++ b/pysnooper/tracer.py @@ -21,8 +21,7 @@ ipython_filename_pattern = re.compile('^$') def get_local_reprs(frame, watch=()): - vars_order = frame.f_code.co_varnames + frame.f_code.co_cellvars + frame.f_code.co_freevars - vars_order += tuple(frame.f_locals.keys()) + vars_order = frame.f_code.co_varnames + frame.f_code.co_cellvars + frame.f_code.co_freevars + tuple(frame.f_locals.keys()) result_items = [(key, utils.get_shortish_repr(value)) for key, value in frame.f_locals.items()] result_items.sort(key=lambda key_value: vars_order.index(key_value[0]))