Skip to content

Commit bb51391

Browse files
committed
Ough, we should unwrap nonmembers first
1 parent 592f9d0 commit bb51391

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/checkmember.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,8 +1345,6 @@ def analyze_enum_class_attribute_access(
13451345
# Skip these since Enum will remove it
13461346
if name in EXCLUDED_ENUM_ATTRIBUTES:
13471347
return report_missing_attribute(mx.original_type, itype, name, mx)
1348-
if name not in itype.type.enum_members:
1349-
return None
13501348

13511349
node = itype.type.get(name)
13521350
if node and node.type:
@@ -1359,6 +1357,9 @@ def analyze_enum_class_attribute_access(
13591357
):
13601358
return proper.args[0]
13611359

1360+
if name not in itype.type.enum_members:
1361+
return None
1362+
13621363
enum_literal = LiteralType(name, fallback=itype)
13631364
return itype.copy_modified(last_known_value=enum_literal)
13641365

0 commit comments

Comments
 (0)