summaryrefslogtreecommitdiff
path: root/sphinx/errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/errors.py')
-rw-r--r--sphinx/errors.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/errors.py b/sphinx/errors.py
index a9172e07b..437e4acd9 100644
--- a/sphinx/errors.py
+++ b/sphinx/errors.py
@@ -58,14 +58,13 @@ class ExtensionError(SphinxError):
def __repr__(self) -> str:
if self.orig_exc:
- return '%s(%r, %r)' % (self.__class__.__name__,
- self.message, self.orig_exc)
- return '%s(%r)' % (self.__class__.__name__, self.message)
+ return f'{self.__class__.__name__}({self.message!r}, {self.orig_exc!r})'
+ return f'{self.__class__.__name__}({self.message!r})'
def __str__(self) -> str:
parent_str = super().__str__()
if self.orig_exc:
- return '%s (exception: %s)' % (parent_str, self.orig_exc)
+ return f'{parent_str} (exception: {self.orig_exc})'
return parent_str