Skip to content

Commit

Permalink
config.expand.StaticModule: handle scenarios when annotated assignmen…
Browse files Browse the repository at this point in the history
…t does not have a value
  • Loading branch information
abravalheri committed Jun 19, 2022
1 parent 6384f26 commit 0b1d090
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setuptools/config/expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def __init__(self, name: str, spec: ModuleSpec):
vars(self).update(locals())
del self.self

def _find_assignments(self) -> Iterator[Tuple[ast.AST, Optional[ast.AST]]]:
def _find_assignments(self) -> Iterator[Tuple[ast.AST, ast.AST]]:
for statement in self.module.body:
if isinstance(statement, ast.Assign):
yield from ((target, statement.value) for target in statement.targets)
elif isinstance(statement, ast.AnnAssign):
elif isinstance(statement, ast.AnnAssign) and statement.value:
yield (statement.target, statement.value)

def __getattr__(self, attr):
Expand Down

0 comments on commit 0b1d090

Please sign in to comment.