summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index d69369d..185f09e 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1790,7 +1790,11 @@ def doc(thing, title='Python Library Documentation: %s', forceload=0,
raise
print(exc)
else:
- output.write(render_doc(thing, title, forceload, plaintext))
+ try:
+ s = render_doc(thing, title, forceload, plaintext)
+ except ImportError as exc:
+ s = str(exc)
+ output.write(s)
def writedoc(thing, forceload=0):
"""Write HTML documentation to a file in the current directory."""