blob: 6c9ca554d361dcd4ae61b867f4dfe5cd91651fc1 (
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
@@ -1491,6 +1491,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')
|