diff options
author | Fred Drake <fdrake@acm.org> | 2001-07-23 19:44:30 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-07-23 19:44:30 (GMT) |
commit | 0a66fcb11666feb1b01e8a607ebc7dde7f9c451c (patch) | |
tree | 9c58fe06f3e7d3763931e3382fc8b42e2c01cd24 /Lib | |
parent | 6fd3b22847c63fc13b67de936507b7e5e6b5e71d (diff) | |
download | cpython-0a66fcb11666feb1b01e8a607ebc7dde7f9c451c.zip cpython-0a66fcb11666feb1b01e8a607ebc7dde7f9c451c.tar.gz cpython-0a66fcb11666feb1b01e8a607ebc7dde7f9c451c.tar.bz2 |
If $TERM is "dumb" or "emacs", just dump the text instead of trying to run
"less".
Patch contributed by Alex Convertry.
This closes SF patch #443551.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/pydoc.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 9ec57aa..fe90a01 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -954,6 +954,8 @@ def getpager(): return plainpager if not sys.stdin.isatty() or not sys.stdout.isatty(): return plainpager + if os.environ.get('TERM') in ['dumb', 'emacs']: + return lambda text: sys.stdout.write(text) if os.environ.has_key('PAGER'): if sys.platform == 'win32': # pipes completely broken in Windows return lambda text: tempfilepager(plain(text), os.environ['PAGER']) |