← 返回首页
Pass "None" as output argument to pydoc.Helper in Python 2.6+. · bpython/bpython@06628e1 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

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

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎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)

Footer

© 2026 GitHub, Inc.