Skip to content

Commit e5bdef0

Browse files
committed
Add a suggestion from chgnrdv
1 parent bdc9e9b commit e5bdef0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/pydoc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,10 +1781,10 @@ def doc(thing, title='Python Library Documentation: %s', forceload=0,
17811781
if output is None:
17821782
try:
17831783
pager(render_doc(thing, title, forceload))
1784-
except ImportError:
1784+
except ImportError as exc:
17851785
if is_cli:
1786-
raise ImportError(missing_pattern % thing) from None
1787-
pager(missing_pattern % thing)
1786+
raise
1787+
print(exc)
17881788
else:
17891789
output.write(render_doc(thing, title, forceload, plaintext))
17901790

0 commit comments

Comments
 (0)