From 36a3ae8ad3820d477b1d5d9d412babd11a14e697 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Wed, 20 Jan 2021 14:49:22 +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