- Issue #8637: Honor a pager set by the env var MANPAGER (in preference to

one set by the env var PAGER).
This commit is contained in:
doko@ubuntu.com 2016-06-14 08:39:31 +02:00
parent 8e4b7ac7fe
commit 965754521e
2 changed files with 5 additions and 1 deletions

View File

@ -1429,7 +1429,8 @@ def getpager():
return plainpager
if not sys.stdin.isatty() or not sys.stdout.isatty():
return plainpager
if 'PAGER' in os.environ:
use_pager = os.environ.get('MANPAGER') or os.environ.get('PAGER')
if use_pager:
if sys.platform == 'win32': # pipes completely broken in Windows
return lambda text: tempfilepager(plain(text), os.environ['PAGER'])
elif os.environ.get('TERM') in ('dumb', 'emacs'):

View File

@ -10,6 +10,9 @@ What's New in Python 3.6.0 alpha 3
Library
-------
- Issue #8637: Honor a pager set by the env var MANPAGER (in preference to
one set by the env var PAGER).
- Issue #22636: Avoid shell injection problems with
ctypes.util.find_library().