Skip to content

Commit

Permalink
Format code with Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Jan 28, 2025
1 parent fbbc52d commit cb7c884
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
4 changes: 1 addition & 3 deletions comtypes/_post_coinit/unknwn.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ def __eq__(self, other):
if not isinstance(other, _compointer_base):
return False
# get the value property of the c_void_p baseclass, this is the pointer value
return (
super().value == super(_compointer_base, other).value
)
return super().value == super(_compointer_base, other).value

def __hash__(self):
"""Return the hash value of the pointer."""
Expand Down
4 changes: 1 addition & 3 deletions comtypes/test/test_npsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ def call_disabled(self):
from comtypes import npsupport

if npsupport.enabled:
raise OSError(
"Expected numpy interop not to be enabled but it is."
)
raise OSError("Expected numpy interop not to be enabled but it is.")
with self.assertRaises(disabled_error):
func(self)

Expand Down
1 change: 1 addition & 0 deletions comtypes/test/test_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def check_perf(rep=20000):
ptr_var = pointer(variable)

import pickle

try:
previous = pickle.load(open("result.pickle", "rb"))
except OSError:
Expand Down
4 changes: 2 additions & 2 deletions comtypes/tools/codegenerator/packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class PackingError(Exception):

# XXX These should be filtered out in gccxmlparser.
dont_assert_size = {
"__si_class_type_info_pseudo",
"__class_type_info_pseudo",
"__si_class_type_info_pseudo",
"__class_type_info_pseudo",
}


Expand Down
14 changes: 7 additions & 7 deletions comtypes/tools/tlbparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ def ParseDispatch(
# I have encountered typlibs where only "QueryInterface", "AddRef"
# and "Release" are to be skipped.
ignored_names = {
"QueryInterface",
"AddRef",
"Release",
"GetTypeInfoCount",
"GetTypeInfo",
"GetIDsOfNames",
"Invoke",
"QueryInterface",
"AddRef",
"Release",
"GetTypeInfoCount",
"GetTypeInfo",
"GetIDsOfNames",
"Invoke",
}

for i in range(ta.cFuncs):
Expand Down

0 comments on commit cb7c884

Please sign in to comment.