summaryrefslogtreecommitdiffstats
path: root/Lib/test/support/os_helper.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2021-09-14 23:31:45 (GMT)
committerGitHub <noreply@github.com>2021-09-14 23:31:45 (GMT)
commita65c86889e208dddb26a7ebe7840c24edbcca775 (patch)
treeec55222c3ac183806fc06f0d60514ab21e6dc560 /Lib/test/support/os_helper.py
parent1aaa85949717e4ab2ed700e58762f0a3ce049a37 (diff)
downloadcpython-a65c86889e208dddb26a7ebe7840c24edbcca775.zip
cpython-a65c86889e208dddb26a7ebe7840c24edbcca775.tar.gz
cpython-a65c86889e208dddb26a7ebe7840c24edbcca775.tar.bz2
bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of frozen modules. (gh-28320)
Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file. This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now. https://bugs.python.org/issue45020
Diffstat (limited to 'Lib/test/support/os_helper.py')
-rw-r--r--Lib/test/support/os_helper.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/support/os_helper.py b/Lib/test/support/os_helper.py
index d9807a1..ce01417 100644
--- a/Lib/test/support/os_helper.py
+++ b/Lib/test/support/os_helper.py
@@ -599,6 +599,10 @@ class EnvironmentVarGuard(collections.abc.MutableMapping):
def unset(self, envvar):
del self[envvar]
+ def copy(self):
+ # We do what os.environ.copy() does.
+ return dict(self)
+
def __enter__(self):
return self