Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f609a34

Browse files
committed
help() was not paging to the shell. Issue1650.
1 parent c3d7fe0 commit f609a34

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

Lib/idlelib/NEWS.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
What's New in IDLE 3.0a3?
22
=========================
33

4-
*Release date: XX-XXX-200X*
4+
*Release date: XX-XXX-2008*
5+
6+
- help() was not paging to the shell. Issue1650.
57

68
- CodeContext was not importing.
79

Lib/idlelib/PyShell.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,14 @@ def __init__(self, flist=None):
828828
sys.stdout = self.stdout
829829
sys.stderr = self.stderr
830830
sys.stdin = self
831+
try:
832+
# page help() text to shell.
833+
import pydoc # import must be done here to capture i/o rebinding.
834+
# XXX KBK 27Dec07 use a textView someday, but must work w/o subproc
835+
pydoc.pager = pydoc.plainpager
836+
except:
837+
sys.stderr = sys.__stderr__
838+
raise
831839
#
832840
self.history = self.History(self.text)
833841
#

Lib/idlelib/run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ def handle(self):
247247
sys.stdin = self.console = self.get_remote_proxy("stdin")
248248
sys.stdout = self.get_remote_proxy("stdout")
249249
sys.stderr = self.get_remote_proxy("stderr")
250+
# page help() text to shell.
251+
import pydoc # import must be done here to capture i/o binding
252+
pydoc.pager = pydoc.plainpager
250253
from idlelib import IOBinding
251254
sys.stdin.encoding = sys.stdout.encoding = \
252255
sys.stderr.encoding = IOBinding.encoding

0 commit comments

Comments
 (0)