Skip to content

Commit

Permalink
In tools/codegenerator/heads.py, type(t) == T -> type(t) is T.
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed Jan 19, 2025
1 parent 4218a9e commit 65c2424
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions comtypes/tools/codegenerator/heads.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def write(self, head: typedesc.StructureHead, basenames: Sequence[str]) -> None:
print("assert 0, 'cannot generate code for IUnknown'", file=self.stream)
print(f"class {head.struct.name}(_com_interface):", file=self.stream)
print(" pass", file=self.stream)
elif type(head.struct) == typedesc.Structure:
elif type(head.struct) is typedesc.Structure:
print(f"class {head.struct.name}(Structure):", file=self.stream)
if hasattr(head.struct, "_recordinfo_"):
print(
Expand All @@ -62,7 +62,7 @@ def write(self, head: typedesc.StructureHead, basenames: Sequence[str]) -> None:
)
else:
print(" pass", file=self.stream)
elif type(head.struct) == typedesc.Union:
elif type(head.struct) is typedesc.Union:
print(f"class {head.struct.name}(Union):", file=self.stream)
print(" pass", file=self.stream)

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ ignore = ["E402"]
"comtypes/server/inprocserver.py" = ["E713", "E722", "F403", "F405", "F841"]
"comtypes/server/localserver.py" = ["F401", "F403", "F405"]
"comtypes/server/register.py" = ["F403", "F405", "E713", "E731"]
"comtypes/tools/codegenerator/heads.py" = ["E721"]
"comtypes/tools/codegenerator/packing.py" = ["F821", "F841"]
"comtypes/tools/tlbparser.py" = ["F401"]
"comtypes/tools/typedesc.py" = ["F403", "F405"]
Expand Down

0 comments on commit 65c2424

Please sign in to comment.