[Python-checkins] CVS: python/dist/src/Lib pydoc.py,1.39,1.40

Fred L. Drake fdrake@users.sourceforge.net
Mon, 23 Jul 2001 12:44:32 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv1202/Lib

Modified Files:
	pydoc.py 
Log Message:

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.


Index: pydoc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** pydoc.py	2001/05/10 18:41:02	1.39
--- pydoc.py	2001/07/23 19:44:30	1.40
***************
*** 955,958 ****
--- 955,960 ----
      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