pydoc-use-pager
authorMatthias Klose <doko@debian.org>
Wed, 8 Jun 2022 09:45:57 +0000 (10:45 +0100)
committerMatthias Klose <doko@debian.org>
Wed, 8 Jun 2022 09:45:57 +0000 (10:45 +0100)
# 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

index 24bf2f7bebee47ce9d7d3985688ac16a16b2a9fb..595d73c2570ac1c5ea9989842db9d2bae14ac37c 100755 (executable)
@@ -1582,6 +1582,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')