Skip to content

Commit 0587b4c

Browse files
vstinnerestyxx
authored andcommitted
pythongh-121359: Run test_pyrepl in isolated mode (python#121414)
run_repl() now pass the -I option (isolated mode) to Python if the 'env' parameter is not set.
1 parent ed36fa1 commit 0587b4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,11 @@ def test_not_wiping_history_file(self):
927927

928928
def run_repl(self, repl_input: str | list[str], env: dict | None = None) -> tuple[str, int]:
929929
master_fd, slave_fd = pty.openpty()
930+
cmd = [sys.executable, "-i", "-u"]
931+
if env is None:
932+
cmd.append("-I")
930933
process = subprocess.Popen(
931-
[sys.executable, "-i", "-u"],
934+
cmd,
932935
stdin=slave_fd,
933936
stdout=slave_fd,
934937
stderr=slave_fd,

0 commit comments

Comments
 (0)