diff options
author | doko@ubuntu.com <doko@ubuntu.com> | 2016-06-14 06:39:31 (GMT) |
---|---|---|
committer | doko@ubuntu.com <doko@ubuntu.com> | 2016-06-14 06:39:31 (GMT) |
commit | 965754521e0e8bc5291f2839d8d42c375c5c1eb2 (patch) | |
tree | 9b649e67973b5f78cad384ac0ad303aa7b8b64d8 /Lib/pydoc.py | |
parent | 8e4b7ac7fee89eab26440eee5ce322d41e235fa1 (diff) | |
download | cpython-965754521e0e8bc5291f2839d8d42c375c5c1eb2.zip cpython-965754521e0e8bc5291f2839d8d42c375c5c1eb2.tar.gz cpython-965754521e0e8bc5291f2839d8d42c375c5c1eb2.tar.bz2 |
- Issue #8637: Honor a pager set by the env var MANPAGER (in preference to
one set by the env var PAGER).
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r-- | Lib/pydoc.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 063aa9c..de0084c 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'): |