mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #16400: Add command line option for isolated mode.
-I Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script’s directory nor the user’s site-packages directory. All PYTHON* environment variables are ignored, too. Further restrictions may be imposed to prevent the user from injecting malicious code.
This commit is contained in:
parent
562d9cbfe9
commit
ad73a9cf97
11 changed files with 77 additions and 10 deletions
|
@ -515,7 +515,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
attrs = ("debug",
|
||||
"inspect", "interactive", "optimize", "dont_write_bytecode",
|
||||
"no_user_site", "no_site", "ignore_environment", "verbose",
|
||||
"bytes_warning", "quiet", "hash_randomization")
|
||||
"bytes_warning", "quiet", "hash_randomization", "isolated")
|
||||
for attr in attrs:
|
||||
self.assertTrue(hasattr(sys.flags, attr), attr)
|
||||
self.assertEqual(type(getattr(sys.flags, attr)), int, attr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue