bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131)

This commit is contained in:
native-api 2021-05-20 13:25:37 +03:00 committed by GitHub
parent 58a993957a
commit 1270ad6ec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,8 @@ class HelperFunctionsTests(unittest.TestCase):
site.USER_SITE = self.old_site
site.PREFIXES = self.old_prefixes
sysconfig._CONFIG_VARS = self.original_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)