Skip to content

Commit 0b1d090

Browse files
committed
config.expand.StaticModule: handle scenarios when annotated assignment does not have a value
1 parent 6384f26 commit 0b1d090

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

setuptools/config/expand.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ def __init__(self, name: str, spec: ModuleSpec):
6666
vars(self).update(locals())
6767
del self.self
6868

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

7676
def __getattr__(self, attr):

0 commit comments

Comments
 (0)