From 5db273a7731098ba6cd5f07eea3be51c1838e59b Mon Sep 17 00:00:00 2001 From: Benjamin Attal Date: Mon, 14 Apr 2014 13:13:20 -0400 Subject: [PATCH] Bugfixes for _serialize function in bitshift/parser/python.py --- bitshift/parser/python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bitshift/parser/python.py b/bitshift/parser/python.py index abccfb5..51a3555 100644 --- a/bitshift/parser/python.py +++ b/bitshift/parser/python.py @@ -70,12 +70,12 @@ def _serialize(tree): start_line, end_line = _start_n_end(cur_node) accum['classes'][cur_node.name] = {'start_ln': start_line , 'end_ln': end_line} - elif isinstance(cur_node, ast.AST): + if isinstance(cur_node, ast.AST): for k in cur_node.__dict__.keys(): - node = node.__dict__[k] + node = cur_node.__dict__[k] _helper(node, accum) - accum = {} + accum = {'vars': {}, 'functions': {}, 'classes': {}} _helper(tree, accum) return accum