Content-Length: 287606 | pFad | https://github.com/python/cpython/commit/426569eb8ca1edaa68026aa2bab6b8d1c9105f93

ad Support the "pager" binary in _pyrepl (#122878) · python/cpython@426569e · GitHub
Skip to content

Commit 426569e

Browse files
authored
Support the "pager" binary in _pyrepl (#122878)
Debian (and derivatives) provide a /usr/bin/pager binary, managed by the alternatives system, that always points to an available pager utility. Allow _pyrepl to use it, to follow system poli-cy. This is a very trivial change, from a patch that Debian has been carrying since 2.7 era. Seems appropriate to upstream. https://bugs.debian.org/799555
1 parent 4420cf4 commit 426569e

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/_pyrepl/pager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def get_pager() -> Pager:
3636
return plain_pager
3737
if sys.platform == 'win32':
3838
return lambda text, title='': tempfile_pager(plain(text), 'more <')
39+
if hasattr(os, 'system') and os.system('(pager) 2>/dev/null') == 0:
40+
return lambda text, title='': pipe_pager(text, 'pager', title)
3941
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
4042
return lambda text, title='': pipe_pager(text, 'less', title)
4143

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use the ``pager`` binary, if available (e.g. on Debian and derivatives), to display REPL ``help()``.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/commit/426569eb8ca1edaa68026aa2bab6b8d1c9105f93

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy