summaryrefslogtreecommitdiff
path: root/debian/patches/pydoc-use-pager.diff
blob: ca2b49f61694a64c01445e11bd8b76f93c1b8dad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# DP: pydoc: use the pager command if available.

--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1473,6 +1473,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')