mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
[3.13] gh-140170: Fix test_site with -s flag (GH-140179) (#140201)
gh-140170: Fix test_site with -s flag (GH-140179)
Commit
(cherry picked from commit 7ac94fcb1d)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
parent
f09a6a2fc8
commit
9fb32eb83e
1 changed files with 5 additions and 2 deletions
|
|
@ -836,12 +836,15 @@ def get_excepted_output(self, *args):
|
|||
return 10, None
|
||||
|
||||
def invoke_command_line(self, *args):
|
||||
args = ["-m", "site", *args]
|
||||
cmd_args = []
|
||||
if sys.flags.no_user_site:
|
||||
cmd_args.append("-s")
|
||||
cmd_args.extend(["-m", "site", *args])
|
||||
|
||||
with EnvironmentVarGuard() as env:
|
||||
env["PYTHONUTF8"] = "1"
|
||||
env["PYTHONIOENCODING"] = "utf-8"
|
||||
proc = spawn_python(*args, text=True, env=env,
|
||||
proc = spawn_python(*cmd_args, text=True, env=env,
|
||||
encoding='utf-8', errors='replace')
|
||||
|
||||
output = kill_python(proc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue