Skip to content

Commit e6fb90b

Browse files
committed
pythongh-102541: Fix Helper.help when output is non default
1 parent 7a56a41 commit e6fb90b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/pydoc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,10 @@ def doc(thing, title='Python Library Documentation: %s', forceload=0,
17901790
raise
17911791
print(exc)
17921792
else:
1793-
output.write(render_doc(thing, title, forceload, plaintext))
1793+
try:
1794+
output.write(render_doc(thing, title, forceload, plaintext))
1795+
except ImportError as exc:
1796+
output.write(str(exc))
17941797

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

0 commit comments

Comments
 (0)