Skip to content

Commit

Permalink
In _compointer_base.
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed Nov 4, 2024
1 parent c5c4796 commit 6899899
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comtypes/_post_coinit/unknwn.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def __get_value(self):

def __repr__(self):
ptr = super(_compointer_base, self).value
return "<%s ptr=0x%x at %x>" % (self.__class__.__name__, ptr or 0, id(self))
return f"<{self.__class__.__name__} ptr=0x{ptr or 0:x} at {id(self):x}>"

# This fixes the problem when there are multiple python interface types
# wrapping the same COM interface. This could happen because some interfaces
Expand Down Expand Up @@ -338,7 +338,7 @@ def from_param(cls, value):
# a kind of QueryInterface
return table[cls._iid_]
except KeyError:
raise TypeError("Interface %s not supported" % cls._iid_)
raise TypeError(f"Interface {cls._iid_} not supported")
return value.QueryInterface(cls.__com_interface__)


Expand Down

0 comments on commit 6899899

Please sign in to comment.