try executing 'less' in a parenthesized subshell - prevents systems like

Solaris from squawking if less isn't available.  See
http://python.org/sf/612111 for details.
This commit is contained in:
Skip Montanaro 2002-09-26 21:44:57 +00:00
parent 479f3d3d2a
commit d404bee2e2
1 changed files with 1 additions and 1 deletions

View File

@ -1199,7 +1199,7 @@ def getpager():
return lambda text: pipepager(text, os.environ['PAGER'])
if sys.platform == 'win32' or sys.platform.startswith('os2'):
return lambda text: tempfilepager(plain(text), 'more <')
if hasattr(os, 'system') and os.system('less 2>/dev/null') == 0:
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
return lambda text: pipepager(text, 'less')
import tempfile