summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/22_all_tests_environment.patch')
-rw-r--r--patches/22_all_tests_environment.patch19
1 files changed, 17 insertions, 2 deletions
diff --git a/patches/22_all_tests_environment.patch b/patches/22_all_tests_environment.patch
index 3ccb281..6eb75f8 100644
--- a/patches/22_all_tests_environment.patch
+++ b/patches/22_all_tests_environment.patch
@@ -2,7 +2,7 @@ https://bugs.python.org/issue1674555
--- Lib/site.py
+++ Lib/site.py
-@@ -545,8 +545,9 @@
+@@ -545,8 +545,12 @@
known_paths = venv(known_paths)
if ENABLE_USER_SITE is None:
ENABLE_USER_SITE = check_enableusersite()
@@ -11,6 +11,9 @@ https://bugs.python.org/issue1674555
+ if os.environ.get("_PYTHONNOSITEPACKAGES") is None:
+ known_paths = addusersitepackages(known_paths)
+ known_paths = addsitepackages(known_paths)
++ else:
++ # Initialize USER_BASE and USER_SITE.
++ getusersitepackages()
setquit()
setcopyright()
sethelper()
@@ -163,9 +166,21 @@ https://bugs.python.org/issue1674555
if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE):
# need to add user site directory for tests
os.makedirs(site.USER_SITE)
+@@ -436,8 +441,11 @@
+ def test_startup_imports(self):
+ # This tests checks which modules are loaded by Python when it
+ # initially starts upon startup.
++ env = os.environ.copy()
++ env["_PYTHONNOSITEPACKAGES"] = "1"
+ popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',
+ 'import sys; print(set(sys.modules))'],
++ env=env,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = popen.communicate()
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -959,7 +959,7 @@
+@@ -960,7 +960,7 @@
######################################################################
TESTOPTS= $(EXTRATESTOPTS)