Skip to content

Commit

Permalink
pythongh-102541: Fix traceback when Helper.help output is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
Eclips4 committed Jun 20, 2023
1 parent 6bfd8a2 commit 33608a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,10 @@ def doc(thing, title='Python Library Documentation: %s', forceload=0,
raise
print(exc)
else:
output.write(render_doc(thing, title, forceload, plaintext))
try:
output.write(render_doc(thing, title, forceload, plaintext))
except ImportError as exc:
output.write(str(exc))

def writedoc(thing, forceload=0):
"""Write HTML documentation to a file in the current directory."""
Expand Down

0 comments on commit 33608a4

Please sign in to comment.