Skip to content

Commit 2f20512

Browse files
gh-161039: Fix detection of less 706 and later by the pydoc pager (#161040)
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent efeeb6c commit 2f20512

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
@@ -36,7 +36,7 @@ def get_pager() -> Pager:
3636
return lambda text, title='': tempfile_pager(plain(text), 'more <')
3737
if hasattr(os, 'system') and os.system('(pager) 2>/dev/null') == 0:
3838
return lambda text, title='': pipe_pager(text, 'pager', title)
39-
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
39+
if hasattr(os, 'system') and os.system('(less -V) >/dev/null 2>&1') == 0:
4040
return lambda text, title='': pipe_pager(text, 'less', title)
4141

4242
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)