summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc/importer.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-07-05 01:32:54 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-07-05 01:32:54 +0900
commitec3754bd94eaa3aa3c5410ee6ab100bb27bfb798 (patch)
treed0446a967a4f8cbc3208d48d6bf3d9b7c90ca25e /sphinx/ext/autodoc/importer.py
parentb268963709dc9256cf711d4cc054a86e70226702 (diff)
parent9fd9edebb47a3a5eda8c6065b12b71cdb0985a73 (diff)
downloadsphinx-git-ec3754bd94eaa3aa3c5410ee6ab100bb27bfb798.tar.gz
Merge branch '3.x'
Diffstat (limited to 'sphinx/ext/autodoc/importer.py')
-rw-r--r--sphinx/ext/autodoc/importer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/ext/autodoc/importer.py b/sphinx/ext/autodoc/importer.py
index cb06edbac..637c69814 100644
--- a/sphinx/ext/autodoc/importer.py
+++ b/sphinx/ext/autodoc/importer.py
@@ -32,7 +32,7 @@ def import_module(modname: str, warningiserror: bool = False) -> Any:
except BaseException as exc:
# Importing modules may cause any side effects, including
# SystemExit, so we need to catch all errors.
- raise ImportError(exc, traceback.format_exc())
+ raise ImportError(exc, traceback.format_exc()) from exc
def import_object(modname: str, objpath: List[str], objtype: str = '',
@@ -97,7 +97,7 @@ def import_object(modname: str, objpath: List[str], objtype: str = '',
errmsg += '; the following exception was raised:\n%s' % traceback.format_exc()
logger.debug(errmsg)
- raise ImportError(errmsg)
+ raise ImportError(errmsg) from exc
def get_module_members(module: Any) -> List[Tuple[str, Any]]: