Skip to content

Commit

Permalink
Change the argument names
Browse files Browse the repository at this point in the history
in `IUnknown_AddRef` and `IUnknown_Release` from `__` prefixes to `_` prefixes.

This resolves linter warnings that mistakenly interpreted the `__` prefix as
the old-style positional-only arguments.
  • Loading branch information
junkmd committed Dec 21, 2024
1 parent 01ec70d commit d1a59fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions comtypes/_comobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ def __unkeep__(obj: "COMObject") -> None:
def IUnknown_AddRef(
self,
this: Any,
__InterlockedIncrement: Callable[[c_long], int] = _InterlockedIncrement,
_increment: Callable[[c_long], int] = _InterlockedIncrement,
_debug=_debug,
) -> int:
result = __InterlockedIncrement(self._refcnt)
result = _increment(self._refcnt)
if result == 1:
self.__keep__(self)
_debug("%r.AddRef() -> %s", self, result)
Expand All @@ -298,14 +298,14 @@ def _final_release_(self) -> None:
def IUnknown_Release(
self,
this: Any,
__InterlockedDecrement: Callable[[c_long], int] = _InterlockedDecrement,
_decrement: Callable[[c_long], int] = _InterlockedDecrement,
_debug=_debug,
) -> int:
# If this is called at COM shutdown, _InterlockedDecrement()
# must still be available, although module level variables may
# have been deleted already - so we supply it as default
# argument.
result = __InterlockedDecrement(self._refcnt)
result = _decrement(self._refcnt)
_debug("%r.Release() -> %s", self, result)
if result == 0:
self._final_release_()
Expand Down

0 comments on commit d1a59fb

Please sign in to comment.