Skip to content

Commit 1c6153a

Browse files
johnslavikvstinner
andcommitted
Remove readline logic (it is unnecessary)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 4de3631 commit 1c6153a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Lib/test/support/pty_helper.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,18 @@
1010

1111
from test.support.import_helper import import_module
1212

13-
def run_pty(script, input=b"dummy input\r", env=None, readline=None):
13+
def run_pty(script, input=b"dummy input\r", env=None):
1414
pty = import_module('pty')
1515
output = bytearray()
1616
[master, slave] = pty.openpty()
1717
args = (sys.executable, '-c', script)
1818

19-
if readline is None:
20-
readline = "readline" in sys.modules
21-
if readline:
22-
# Isolate readline from personal init files by setting INPUTRC
23-
# to an empty file. See also GH-142353.
24-
if env is None:
25-
env = {**os.environ.copy(), "INPUTRC": os.devnull}
26-
else:
27-
env.setdefault("INPUTRC", os.devnull)
19+
# Isolate readline from personal init files by setting INPUTRC
20+
# to an empty file. See also GH-142353.
21+
if env is None:
22+
env = {**os.environ.copy(), "INPUTRC": os.devnull}
23+
else:
24+
env.setdefault("INPUTRC", os.devnull)
2825

2926
proc = subprocess.Popen(args, stdin=slave, stdout=slave, stderr=slave, env=env)
3027
os.close(slave)

0 commit comments

Comments
 (0)