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

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