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 5553231 commit c8fd192
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1432,11 +1432,11 @@ def getpager():
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'])
return lambda text: tempfilepager(plain(text), use_pager)
elif os.environ.get('TERM') in ('dumb', 'emacs'):
return lambda text: pipepager(plain(text), os.environ['PAGER'])
return lambda text: pipepager(plain(text), use_pager)
else:
return lambda text: pipepager(text, os.environ['PAGER'])
return lambda text: pipepager(text, use_pager)
if os.environ.get('TERM') in ('dumb', 'emacs'):
return plainpager
if sys.platform == 'win32':
Expand Down

0 comments on commit c8fd192

Please sign in to comment.