From: doko@ubuntu.com Date: Tue, 14 Jun 2016 06:39:31 +0000 (+0200) Subject: - Issue #8637: Honor a pager set by the env var MANPAGER (in preference to X-Git-Tag: v3.6.0a3~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=965754521e0e8bc5291f2839d8d42c375c5c1eb2;p=thirdparty%2FPython%2Fcpython.git - Issue #8637: Honor a pager set by the env var MANPAGER (in preference to one set by the env var PAGER). --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 063aa9cf076f..de0084c3e54c 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -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'): diff --git a/Misc/NEWS b/Misc/NEWS index 246896fa909e..956303a3a182 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -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().