]> granicus.if.org Git - python/commitdiff
If $TERM is "dumb" or "emacs", just dump the text instead of trying to run
authorFred Drake <fdrake@acm.org>
Mon, 23 Jul 2001 19:44:30 +0000 (19:44 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 23 Jul 2001 19:44:30 +0000 (19:44 +0000)
"less".
Patch contributed by Alex Convertry.
This closes SF patch #443551.

Lib/pydoc.py

index 9ec57aa38ca0c11d28f4d5b985c16b2ccfc2016a..fe90a01f8e826c358e6429908b33a73026b57b87 100755 (executable)
@@ -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'])