mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
Accept patch to resolve SF bug #651124.
This commit is contained in:
parent
6d98ed4ad2
commit
a487e4eb05
@ -1299,8 +1299,6 @@ 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 plainpager
|
||||
if 'PAGER' in os.environ:
|
||||
if sys.platform == 'win32': # pipes completely broken in Windows
|
||||
return lambda text: tempfilepager(plain(text), os.environ['PAGER'])
|
||||
@ -1308,6 +1306,8 @@ def getpager():
|
||||
return lambda text: pipepager(plain(text), os.environ['PAGER'])
|
||||
else:
|
||||
return lambda text: pipepager(text, os.environ['PAGER'])
|
||||
if os.environ.get('TERM') in ('dumb', 'emacs'):
|
||||
return plainpager
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user