Skip to content

Commit

Permalink
fixes #683
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbarratt committed Jan 17, 2025
1 parent eb5c282 commit 9b8526f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/pyscript/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ async def get_names_set(self, arg, names, nonlocal_names, global_names, local_na

cls_name = arg.__class__.__name__
if cls_name == "Attribute":
full_name = await self.ast_attribute_collapse(arg)
full_name = await self.ast_attribute_collapse(arg, check_undef=False)
if full_name is not None:
names.add(full_name)
return
Expand Down
16 changes: 16 additions & 0 deletions tests/test_unit_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,22 @@ def func(arg):
""",
[0, 1, True, True, True],
],
[
"""
def foo():
def bar():
result = []
result.append("bar")
other = 1
return result
result = bar()
return result
foo()
""",
["bar"],
],
]


Expand Down

0 comments on commit 9b8526f

Please sign in to comment.