Skip to content

Commit

Permalink
In GUID.py, from % placeholders to f-string
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed Jul 15, 2024
1 parent 3abe84b commit aec0a32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comtypes/GUID.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, name=None):
_CLSIDFromString(str(name), byref(self))

def __repr__(self):
return 'GUID("%s")' % str(self)
return f'GUID("{str(self)}")'

def __str__(self) -> str:
p = c_wchar_p()
Expand Down Expand Up @@ -73,7 +73,7 @@ def from_progid(cls, progid: Any) -> "hints.Self":
_CLSIDFromProgID(str(progid), byref(inst))
return inst
else:
raise TypeError("Cannot construct guid from %r" % progid)
raise TypeError(f"Cannot construct guid from {progid!r}")

def as_progid(self) -> str:
"""Convert a GUID into a progid"""
Expand Down

0 comments on commit aec0a32

Please sign in to comment.