diff --git a/comtypes/_comobject.py b/comtypes/_comobject.py index d68699f5..50e5e033 100644 --- a/comtypes/_comobject.py +++ b/comtypes/_comobject.py @@ -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) @@ -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_()