From: Fred Drake Date: Mon, 23 Jul 2001 19:44:30 +0000 (+0000) Subject: If $TERM is "dumb" or "emacs", just dump the text instead of trying to run X-Git-Tag: v2.2a3~980 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0a66fcb11666feb1b01e8a607ebc7dde7f9c451c;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 9ec57aa38ca0..fe90a01f8e82 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'])