Skip to content

Commit 8e78242

Browse files
spaceoneAA-Turner
andauthored
autodoc: fix logging of tracebacks (#13944)
Co-authored-by: Adam Turner <[email protected]>
1 parent 994a062 commit 8e78242

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Contributors
5656
* Etienne Desautels -- apidoc module
5757
* Ezio Melotti -- collapsible sidebar JavaScript
5858
* Filip Vavera -- napoleon todo directive
59+
* Florian Best -- log improvements
5960
* Glenn Matthews -- python domain signature improvements
6061
* Gregory Szorc -- performance improvements
6162
* Henrique Bastos -- SVG support for graphviz extension

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ Bugs fixed
152152
Patch by Jean-François B.
153153
* #13916: HTML Search: do not clear text fragments from the URL on page load.
154154
Patch by Harmen Stoppels.
155+
* #13944: autodoc: show traceback during import in human readable representation.
156+
Patch by Florian Best.
155157

156158

157159
Testing

sphinx/ext/autodoc/_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _import_from_module_and_path(
181181
# _import_module() raises ImportError having real exception obj and
182182
# traceback
183183
real_exc = exc.args[0]
184-
traceback_msg = traceback.format_exception(exc)
184+
traceback_msg = ''.join(traceback.format_exception(exc))
185185
if isinstance(real_exc, SystemExit):
186186
err_parts.append(
187187
'the module executes module level statement '

0 commit comments

Comments
 (0)