From 2a84caec74d0d7dce44de391746d0e2866445d32 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Sun, 1 Dec 2024 14:12:57 +0200 Subject: [PATCH] pydoc-use-pager # DP: pydoc: use the pager command if available. # DP: pydoc: use the pager command if available. Gbp-Pq: Name pydoc-use-pager.diff --- Lib/pydoc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 0a20759..47bce21 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1578,6 +1578,8 @@ def getpager(): return plainpager if sys.platform == 'win32': return lambda text: tempfilepager(plain(text), 'more <') + if hasattr(os, 'system') and os.system('(pager) 2>/dev/null') == 0: + return lambda text: pipepager(text, 'pager') if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0: return lambda text: pipepager(text, 'less') -- 2.30.2