We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ef44f4 commit e067677Copy full SHA for e067677
Lib/test/test_cppext.py
@@ -10,7 +10,6 @@
10
with warnings.catch_warnings():
11
warnings.simplefilter('ignore', DeprecationWarning)
12
from distutils.core import setup, Extension
13
- # Import sysconfig here to make the DeprecationWarning quiet
14
import distutils.sysconfig
15
16
@@ -65,6 +64,12 @@ def restore_env(old_env):
65
64
os.environ.update(old_env)
66
self.addCleanup(restore_env, dict(os.environ))
67
+ def restore_sysconfig_vars(old_config_vars):
68
+ distutils.sysconfig._config_vars.clear()
69
+ distutils.sysconfig._config_vars.update(old_config_vars)
70
+ self.addCleanup(restore_sysconfig_vars,
71
+ dict(distutils.sysconfig._config_vars))
72
+
73
# Build in a temporary directory
74
with os_helper.temp_cwd():
75
self.build()
0 commit comments