summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-07-23 19:44:30 (GMT)
committerFred Drake <fdrake@acm.org>2001-07-23 19:44:30 (GMT)
commit0a66fcb11666feb1b01e8a607ebc7dde7f9c451c (patch)
tree9c58fe06f3e7d3763931e3382fc8b42e2c01cd24 /Lib/pydoc.py
parent6fd3b22847c63fc13b67de936507b7e5e6b5e71d (diff)
downloadcpython-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/pydoc.py')
-rwxr-xr-xLib/pydoc.py2
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'])