Skip to content

Commit

Permalink
Closes issue pyutils#279
Browse files Browse the repository at this point in the history
  • Loading branch information
TTsangSC committed Jun 23, 2024
1 parent c715356 commit ddf3fec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions line_profiler/autoprofile/util_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ def visit_Assign(self, node):
if getattr(target, "id", None) == varname:
self.static_value = _parse_static_node_value(node.value)

def visit_AnnAssign(self, node):
if getattr(node.target, "id", None) == varname:
self.static_value = _parse_static_node_value(node.value)

visitor = StaticVisitor()
visitor.visit(pt)
try:
Expand Down

0 comments on commit ddf3fec

Please sign in to comment.