diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-02-07 11:01:09 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-02-07 11:01:09 +0300 |
commit | 84458da82889e28fc44988601a79c0c562e0e994 (patch) | |
tree | 51466bf9aeae3a27e07c25e1590685508e6fa630 /sphinx/events.py | |
parent | acbe71c15cf355e23f9f48ffa9a3b1b04b46e711 (diff) | |
parent | d0785e549de52252c819aa6209bb0ce4a3078db1 (diff) |
Merge branch '3.x'
Diffstat (limited to 'sphinx/events.py')
-rw-r--r-- | sphinx/events.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/events.py b/sphinx/events.py index a29d551b7..881882b41 100644 --- a/sphinx/events.py +++ b/sphinx/events.py @@ -17,6 +17,7 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, List, NamedTuple, Tuple, from sphinx.errors import ExtensionError, SphinxError from sphinx.locale import __ from sphinx.util import logging +from sphinx.util.inspect import safe_getattr if TYPE_CHECKING: from sphinx.application import Sphinx @@ -104,8 +105,9 @@ class EventManager: except SphinxError: raise except Exception as exc: + modname = safe_getattr(listener.handler, '__module__', None) raise ExtensionError(__("Handler %r for event %r threw an exception") % - (listener.handler, name), exc) from exc + (listener.handler, name), exc, modname=modname) from exc return results def emit_firstresult(self, name: str, *args: Any, |