diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-10-15 20:53:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-15 20:53:05 +0200 |
commit | b2f57b7e5e49253c69bd7335999b20fea9e3633a (patch) | |
tree | 8f829cba740d46ba797a2d8a9c6be38fb19c2881 /astroid/brain/brain_dataclasses.py | |
parent | d4674781d974bd73ca3bfe82fd0816684f2a97d4 (diff) | |
download | astroid-git-b2f57b7e5e49253c69bd7335999b20fea9e3633a.tar.gz |
Fix crash with invalid field call (#1212)
Diffstat (limited to 'astroid/brain/brain_dataclasses.py')
-rw-r--r-- | astroid/brain/brain_dataclasses.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/astroid/brain/brain_dataclasses.py b/astroid/brain/brain_dataclasses.py index 96c38b84..9e86a492 100644 --- a/astroid/brain/brain_dataclasses.py +++ b/astroid/brain/brain_dataclasses.py @@ -308,6 +308,7 @@ def _looks_like_dataclass_field_call(node: Call, check_scope: bool = True) -> bo scope = stmt.scope() if not ( isinstance(stmt, AnnAssign) + and stmt.value is not None and isinstance(scope, ClassDef) and is_decorated_with_dataclass(scope) ): |