summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornative-api <vano@mail.mipt.ru>2021-05-20 10:25:37 (GMT)
committerGitHub <noreply@github.com>2021-05-20 10:25:37 (GMT)
commit1270ad6ec8fe1f71e7d88086474f96f99670ac3a (patch)
tree51061c3ef0e8204b9d783c54eee3a05b9138c900
parent58a993957abec7e47acb20376d2753051fa75452 (diff)
downloadcpython-1270ad6ec8fe1f71e7d88086474f96f99670ac3a.zip
cpython-1270ad6ec8fe1f71e7d88086474f96f99670ac3a.tar.gz
cpython-1270ad6ec8fe1f71e7d88086474f96f99670ac3a.tar.bz2
bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131)
-rw-r--r--Lib/test/test_site.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 9b4ab42..fa74e77 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -79,8 +79,10 @@ class HelperFunctionsTests(unittest.TestCase):
site.USER_SITE = self.old_site
site.PREFIXES = self.old_prefixes
sysconfig._CONFIG_VARS = self.original_vars
- sysconfig._CONFIG_VARS.clear()
- sysconfig._CONFIG_VARS.update(self.old_vars)
+ # _CONFIG_VARS is None before get_config_vars() is called
+ if sysconfig._CONFIG_VARS is not None:
+ sysconfig._CONFIG_VARS.clear()
+ sysconfig._CONFIG_VARS.update(self.old_vars)
def test_makepath(self):
# Test makepath() have an absolute path for its first return value