From 0a66fcb11666feb1b01e8a607ebc7dde7f9c451c Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 23 Jul 2001 19:44:30 +0000 Subject: [PATCH] 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. --- Lib/pydoc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 9ec57aa38ca..fe90a01f8e8 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'])