mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675)
The "-I" command line option (run Python in isolated mode) is now also copied by the multiprocessing and distutils modules when spawning child processes. Previously, only -E and -s options (enabled by -I) were copied. subprocess._args_from_interpreter_flags() now copies the -I flag.
This commit is contained in:
parent
ba57963a95
commit
9de3632715
3 changed files with 20 additions and 4 deletions
|
@ -262,9 +262,7 @@ def _args_from_interpreter_flags():
|
|||
# 'inspect': 'i',
|
||||
# 'interactive': 'i',
|
||||
'dont_write_bytecode': 'B',
|
||||
'no_user_site': 's',
|
||||
'no_site': 'S',
|
||||
'ignore_environment': 'E',
|
||||
'verbose': 'v',
|
||||
'bytes_warning': 'b',
|
||||
'quiet': 'q',
|
||||
|
@ -276,6 +274,14 @@ def _args_from_interpreter_flags():
|
|||
if v > 0:
|
||||
args.append('-' + opt * v)
|
||||
|
||||
if sys.flags.isolated:
|
||||
args.append('-I')
|
||||
else:
|
||||
if sys.flags.ignore_environment:
|
||||
args.append('-E')
|
||||
if sys.flags.no_user_site:
|
||||
args.append('-s')
|
||||
|
||||
# -W options
|
||||
warnopts = sys.warnoptions[:]
|
||||
bytes_warning = sys.flags.bytes_warning
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue