mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix AttributeError in ExtensionError
In Python 3, the attribute BaseException.message doesn't exist.
$ python3
>>> from sphinx.errors import ExtensionError
>>> e = ExtensionError('foo')
>>> repr(e)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sphinx/sphinx/errors.py", line 65, in __repr__
return '%s(%r)' % (self.__class__.__name__, self.message)
AttributeError: 'ExtensionError' object has no attribute 'message'
This commit is contained in:
@@ -55,6 +55,7 @@ class ExtensionError(SphinxError):
|
||||
def __init__(self, message, orig_exc=None):
|
||||
# type: (unicode, Exception) -> None
|
||||
SphinxError.__init__(self, message)
|
||||
self.message = message
|
||||
self.orig_exc = orig_exc
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
Reference in New Issue
Block a user