From 2ab256943ef2d8fca5741cca28711681e971e0e7 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Tue, 21 Dec 2021 19:12:12 +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 1e456df..91ace43 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