Skip to content

Commit 06628e1

Browse files
committed
Pass "None" as output argument to pydoc.Helper in Python 2.6+.
Otherwise, pydoc bypasses the pager in Python 3. Fixes issue #228.
1 parent 23e07c4 commit 06628e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bpython/_internal.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
class _Helper(object):
1111

1212
def __init__(self):
13-
self.helper = pydoc.Helper(sys.stdin, sys.stdout)
13+
if hasattr(pydoc.Helper, "output"):
14+
# See issue #228
15+
self.helper = pydoc.Helper(sys.stdin, None)
16+
else:
17+
self.helper = pydoc.Helper(sys.stdin, sys.stdout)
1418

1519
def __repr__(self):
1620
return ("Type help() for interactive help, "

0 commit comments

Comments
 (0)