mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 02:14:04 +00:00
Move one string of code down in get_local_reprs
This commit is contained in:
parent
472985a32c
commit
49f7dd504b
1 changed files with 1 additions and 2 deletions
|
|
@ -21,11 +21,10 @@ ipython_filename_pattern = re.compile('^<ipython-input-([0-9]+)-.*>$')
|
|||
|
||||
|
||||
def get_local_reprs(frame, watch=()):
|
||||
result_items = [(key, utils.get_shortish_repr(value)) for key, value in frame.f_locals.items()]
|
||||
|
||||
vars_order = frame.f_code.co_varnames + frame.f_code.co_cellvars + frame.f_code.co_freevars
|
||||
vars_order += 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]))
|
||||
result = collections.OrderedDict(result_items)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue