]> granicus.if.org Git - python/commitdiff
try executing 'less' in a parenthesized subshell - prevents systems like
authorSkip Montanaro <skip@pobox.com>
Thu, 26 Sep 2002 21:44:57 +0000 (21:44 +0000)
committerSkip Montanaro <skip@pobox.com>
Thu, 26 Sep 2002 21:44:57 +0000 (21:44 +0000)
Solaris from squawking if less isn't available.  See
http://python.org/sf/612111 for details.

Lib/pydoc.py

index d54bc226b92544a1f8a6d8049999d4a2036f00fb..ecee79b67d33f764c49764cd10cfda322a04fef2 100755 (executable)
@@ -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