https://github.com/python/cpython/commit/6239d41527d5977aa5d44e4b894d719bc045860e
commit: 6239d41527d5977aa5d44e4b894d719bc045860e
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2024-07-05T22:30:08+02:00
summary:
gh-121359: Run test_pyrepl in isolated mode (#121414)
run_repl() now pass the -I option (isolated mode) to Python if the
'env' parameter is not set.
files:
M Lib/test/test_pyrepl/test_pyrepl.py
diff --git a/Lib/test/test_pyrepl/test_pyrepl.py
b/Lib/test/test_pyrepl/test_pyrepl.py
index 93c80467a04546..7621b8af808f53 100644
--- a/Lib/test/test_pyrepl/test_pyrepl.py
+++ b/Lib/test/test_pyrepl/test_pyrepl.py
@@ -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,
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]