Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-07 11:01:09 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-07 11:01:09 +0300
commit84458da82889e28fc44988601a79c0c562e0e994 (patch)
tree51466bf9aeae3a27e07c25e1590685508e6fa630 /sphinx/events.py
parentacbe71c15cf355e23f9f48ffa9a3b1b04b46e711 (diff)
parentd0785e549de52252c819aa6209bb0ce4a3078db1 (diff)
Merge branch '3.x'
Diffstat (limited to 'sphinx/events.py')
-rw-r--r--sphinx/events.py4
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,