Kaydet (Commit) dc567e42 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Use a dict for faster sysconfig startup (issue #13150)

üst 10a99b02
...@@ -24,7 +24,7 @@ __all__ = [ ...@@ -24,7 +24,7 @@ __all__ = [
# XXX _CONFIG_DIR will be set by the Makefile later # XXX _CONFIG_DIR will be set by the Makefile later
_CONFIG_DIR = os.path.normpath(os.path.dirname(__file__)) _CONFIG_DIR = os.path.normpath(os.path.dirname(__file__))
_CONFIG_FILE = os.path.join(_CONFIG_DIR, 'sysconfig.cfg') _CONFIG_FILE = os.path.join(_CONFIG_DIR, 'sysconfig.cfg')
_SCHEMES = RawConfigParser() _SCHEMES = RawConfigParser(dict_type=dict) # Faster than OrderedDict
_SCHEMES.read(_CONFIG_FILE) _SCHEMES.read(_CONFIG_FILE)
_VAR_REPL = re.compile(r'\{([^{]*?)\}') _VAR_REPL = re.compile(r'\{([^{]*?)\}')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment