Skip to content

Commit

Permalink
pythongh-121359: Run test_pyrepl in isolated mode (pythonGH-121414)
Browse files Browse the repository at this point in the history
run_repl() now pass the -I option (isolated mode) to Python if the
'env' parameter is not set.
(cherry picked from commit 6239d41)

Co-authored-by: Victor Stinner <[email protected]>
  • Loading branch information
vstinner authored and miss-islington committed Jul 5, 2024
1 parent bc4cd91 commit e311b77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,11 @@ def test_not_wiping_history_file(self):

def run_repl(self, repl_input: str | list[str], env: dict | None = None) -> tuple[str, int]:
master_fd, slave_fd = pty.openpty()
cmd = [sys.executable, "-i", "-u"]
if env is None:
cmd.append("-I")
process = subprocess.Popen(
[sys.executable, "-i", "-u"],
cmd,
stdin=slave_fd,
stdout=slave_fd,
stderr=slave_fd,
Expand Down

0 comments on commit e311b77

Please sign in to comment.