diff options
author | Éric Araujo <merwok@netwok.org> | 2011-09-19 03:10:45 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-09-19 03:10:45 (GMT) |
commit | 28df8de6af5f859a212af75d818df68fce5a9377 (patch) | |
tree | 2c377b97bd1592785e9a4523d5feaae5ca5873b9 | |
parent | 505f0ebf8839cc0a44d06b2cef96a20e5e693e74 (diff) | |
download | cpython-28df8de6af5f859a212af75d818df68fce5a9377.zip cpython-28df8de6af5f859a212af75d818df68fce5a9377.tar.gz cpython-28df8de6af5f859a212af75d818df68fce5a9377.tar.bz2 |
Make regrtest look at internal dicts in sysconfig.
This reveals problems in the packaging test suite, which I’ll look
into after the regrtest checks are made more usable (see #12314).
-rwxr-xr-x | Lib/test/regrtest.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 65438af..e46f935 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -965,7 +965,9 @@ class saved_test_environment: 'warnings.filters', 'asyncore.socket_map', 'logging._handlers', 'logging._handlerList', 'sys.gettrace', 'sys.warnoptions', 'threading._dangling', - 'multiprocessing.process._dangling') + 'multiprocessing.process._dangling', + 'sysconfig._CONFIG_VARS', 'sysconfig._SCHEMES', + ) def get_sys_argv(self): return id(sys.argv), sys.argv, sys.argv[:] @@ -1083,6 +1085,27 @@ class saved_test_environment: multiprocessing.process._dangling.clear() multiprocessing.process._dangling.update(saved) + def get_sysconfig__CONFIG_VARS(self): + # make sure the dict is initialized + sysconfig.get_config_var('prefix') + return (id(sysconfig._CONFIG_VARS), sysconfig._CONFIG_VARS, + dict(sysconfig._CONFIG_VARS)) + def restore_sysconfig__CONFIG_VARS(self, saved): + sysconfig._CONFIG_VARS = saved[1] + sysconfig._CONFIG_VARS.clear() + sysconfig._CONFIG_VARS.update(saved[2]) + + def get_sysconfig__SCHEMES(self): + # it's mildly evil to look at the internal attribute, but it's easier + # than copying a RawConfigParser object + return (id(sysconfig._SCHEMES), sysconfig._SCHEMES._sections, + sysconfig._SCHEMES._sections.copy()) + def restore_sysconfig__SCHEMES(self, saved): + sysconfig._SCHEMES._sections = saved[1] + sysconfig._SCHEMES._sections.clear() + sysconfig._SCHEMES._sections.update(saved[2]) + + def resource_info(self): for name in self.resources: method_suffix = name.replace('.', '_') |