Skip to content

Commit

Permalink
fix #62
Browse files Browse the repository at this point in the history
  • Loading branch information
Technologicat committed Feb 11, 2021
1 parent ce3c5bf commit d321df8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyan/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,11 @@ def visit_AnnAssign(self, node): # PEP 526, Python 3.6+
self.last_value = None
if node.value is not None:
value = sanitize_exprs(node.value)
# issue #62: value may be an empty list, so it doesn't always have any elements
# even after `sanitize_exprs`.
self.logger.debug(
"AnnAssign %s %s, %s:%s"
% (get_ast_node_name(target[0]), get_ast_node_name(value[0]), self.filename, node.lineno)
% (get_ast_node_name(target[0]), get_ast_node_name(value), self.filename, node.lineno)
)
self.analyze_binding(target, value)
else: # just a type declaration
Expand Down

0 comments on commit d321df8

Please sign in to comment.