Skip to content

Commit

Permalink
gh-121359: Run test_pyrepl in isolated mode (#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.
  • Loading branch information
vstinner committed Jul 5, 2024
1 parent 892e3a1 commit 6239d41
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 6239d41

Please sign in to comment.