Skip to content

Commit 31c7db7

Browse files
Use f-strings instead of repr()
1 parent 9cc2f5c commit 31c7db7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg_resources/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class ResolutionError(Exception):
304304
"""Abstract base for dependency resolution errors"""
305305

306306
def __repr__(self) -> str:
307-
return self.__class__.__name__ + repr(self.args)
307+
return f"{self.__class__.__name__}{self.args!r}"
308308

309309

310310
class VersionConflict(ResolutionError):
@@ -3330,7 +3330,7 @@ def has_version(self) -> bool:
33303330
try:
33313331
self.version
33323332
except ValueError:
3333-
issue_warning("Unbuilt egg for " + repr(self))
3333+
issue_warning(f"Unbuilt egg for {self!r}")
33343334
return False
33353335
except SystemError:
33363336
# TODO: remove this except clause when python/cpython#103632 is fixed.

0 commit comments

Comments
 (0)