Skip to content

Commit c1fa85e

Browse files
committed
Rename variable
1 parent fb04f09 commit c1fa85e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

clang/bindings/python/tests/cindex/test_enums.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,11 @@ def test_all_variants(self):
6969
enum_variant_map = {}
7070
# For all enums in self.enums, extract all enum variants defined in Index.h
7171
for cursor in tu.cursor.walk_preorder():
72-
type_class = cenum_to_pythonenum.get(cursor.type.spelling)
73-
if (
74-
cursor.kind == CursorKind.ENUM_CONSTANT_DECL
75-
and type_class in self.enums
76-
):
77-
if type_class not in enum_variant_map:
78-
enum_variant_map[type_class] = []
79-
enum_variant_map[type_class].append(cursor.enum_value)
72+
python_enum = cenum_to_pythonenum.get(cursor.type.spelling)
73+
if cursor.kind == CursorKind.ENUM_CONSTANT_DECL:
74+
if python_enum not in enum_variant_map:
75+
enum_variant_map[python_enum] = []
76+
enum_variant_map[python_enum].append(cursor.enum_value)
8077

8178
for enum in self.enums:
8279
with self.subTest(enum):

0 commit comments

Comments
 (0)