Skip to content

Commit

Permalink
- Issue python#8637: Honor a pager set by the env var MANPAGER (in pr…
Browse files Browse the repository at this point in the history
…eference to

  one set by the env var PAGER).
  • Loading branch information
doko42 committed Jun 14, 2016
1 parent 8e4b7ac commit 9657545
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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().

Expand Down

0 comments on commit 9657545

Please sign in to comment.