File: _readline.py

package info (click to toggle)
python-consolekit 1.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,152 kB
  • sloc: python: 2,835; makefile: 8
file content (18 lines) | stat: -rw-r--r-- 435 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# pragma: no cover

# stdlib
import sys

if not bool(getattr(sys, "ps1", sys.flags.interactive)):

	try:
		# stdlib
		import readline

		# typeshed thinks the module but not these functions are available on Windows.
		# In reality the whole module is unavailable.
		readline.set_history_length(0)
		readline.set_auto_history(False)
	except (ImportError, AttributeError):
		# Attribute error on PyPy, ImportError on Windows etc.
		pass