Skip to content

Commit

Permalink
In codegenerator, type(m) is T -> isinstance(m, T)
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed Jan 18, 2025
1 parent 8b46b74 commit 9e4c3f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions comtypes/tools/codegenerator/codegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,16 @@ def StructureBody(self, body: typedesc.StructureBody) -> None:
fields: List[typedesc.Field] = []
methods: List[typedesc.Method] = []
for m in body.struct.members:
if type(m) is typedesc.Field:
if isinstance(m, typedesc.Field):
fields.append(m)
if type(m.typ) is typedesc.Typedef:
if isinstance(m.typ, typedesc.Typedef):
self.generate(get_real_type(m.typ))
self.generate(m.typ)
elif type(m) is typedesc.Method:
elif isinstance(m, typedesc.Method):
methods.append(m)
self.generate(m.returns)
self.generate_all(m.iterArgTypes())
elif type(m) is typedesc.Constructor:
elif isinstance(m, typedesc.Constructor):
pass

# we don't need _pack_ on Unions (I hope, at least), and not
Expand Down

0 comments on commit 9e4c3f3

Please sign in to comment.