From 069340a3c1a2f7532e18b3317714b261c41e6da7 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Tue, 8 Dec 2020 07:51:42 +0000 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