Skip to content

Commit 1e379e8

Browse files
miss-islingtontmzullingerStanFromIreland
authored
[3.15] gh-161039: Fix detection of less 706 and later by the pydoc pager (GH-161040) (#161148)
(cherry picked from commit 2f20512) Co-authored-by: Todd Zullinger <tmz@pobox.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 8668764 commit 1e379e8

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎Lib/_pyrepl/pager.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_pager() -> Pager:
3838
return lambda text, title='': tempfile_pager(plain(text), 'more <')
3939
if hasattr(os, 'system') and os.system('(pager) 2>/dev/null') == 0:
4040
return lambda text, title='': pipe_pager(text, 'pager', title)
41-
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
41+
if hasattr(os, 'system') and os.system('(less -V) >/dev/null 2>&1') == 0:
4242
return lambda text, title='': pipe_pager(text, 'less', title)
4343

4444
import tempfile
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the :mod:`pydoc` pager not detecting ``less`` 706 and newer.

0 commit comments

Comments
 (0)