8000 bpo-36160: Fix test_site so that it can run independently of other te… · python/cpython@1270ad6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1270ad6

Browse files
authored
bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131)
1 parent 58a9939 commit 1270ad6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_site.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ def tearDown(self):
7979
site.USER_SITE = self.old_site
8080
site.PREFIXES = self.old_prefixes
8181
sysconfig._CONFIG_VARS = self.original_vars
82-
sysconfig._CONFIG_VARS.clear()
83-
sysconfig._CONFIG_VARS.update(self.old_vars)
82+
# _CONFIG_VARS is None before get_config_vars() is called
83+
if sysconfig._CONFIG_VARS is not None:
84+
sysconfig._CONFIG_VARS.clear()
85+
sysconfig._CONFIG_VARS.update(self.old_vars)
8486

8587
def test_makepath(self):
8688
# Test makepath() have an absolute path for its first return value

0 commit comments

Comments
 (0)
0