Skip to content

Commit 9b8526f

Browse files
committed
fixes #683
1 parent eb5c282 commit 9b8526f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

custom_components/pyscript/eval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ async def get_names_set(self, arg, names, nonlocal_names, global_names, local_na
20472047

20482048
cls_name = arg.__class__.__name__
20492049
if cls_name == "Attribute":
2050-
full_name = await self.ast_attribute_collapse(arg)
2050+
full_name = await self.ast_attribute_collapse(arg, check_undef=False)
20512051
if full_name is not None:
20522052
names.add(full_name)
20532053
return

tests/test_unit_eval.py

+16
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,22 @@ def func(arg):
13901390
""",
13911391
[0, 1, True, True, True],
13921392
],
1393+
[
1394+
"""
1395+
def foo():
1396+
def bar():
1397+
result = []
1398+
result.append("bar")
1399+
other = 1
1400+
return result
1401+
1402+
result = bar()
1403+
return result
1404+
1405+
foo()
1406+
""",
1407+
["bar"],
1408+
],
13931409
]
13941410

13951411

0 commit comments

Comments
 (0)