summaryrefslogtreecommitdiffstats
path: root/Lib/sysconfig.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-10-11 22:24:55 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-10-11 22:24:55 (GMT)
commit8c9cd5a3d466487c54440a47c8c04959e736aae0 (patch)
tree020a0d5f7b3760b1fa92eed862f813344226a2ce /Lib/sysconfig.py
parentfd4722cacf4885c29d358b8de6718b51a8149fa3 (diff)
downloadcpython-8c9cd5a3d466487c54440a47c8c04959e736aae0.zip
cpython-8c9cd5a3d466487c54440a47c8c04959e736aae0.tar.gz
cpython-8c9cd5a3d466487c54440a47c8c04959e736aae0.tar.bz2
Issue #19205: Don't import the 're' module in site and sysconfig module to
to speed up interpreter start.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r--Lib/sysconfig.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index ee38a20..efc9a84 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -1,7 +1,6 @@
"""Access to Python's configuration information."""
import os
-import re
import sys
from os.path import pardir, realpath
@@ -222,6 +221,7 @@ def _parse_makefile(filename, vars=None):
"""
# Regexes needed for parsing Makefile (and similar syntaxes,
# like old-style Setup files).
+ import re
_variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
_findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)")
_findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}")
@@ -435,6 +435,7 @@ def parse_config_h(fp, vars=None):
"""
if vars is None:
vars = {}
+ import re
define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
@@ -658,6 +659,7 @@ def get_platform():
return "%s-%s.%s" % (osname, version, release)
elif osname[:6] == "cygwin":
osname = "cygwin"
+ import re
rel_re = re.compile(r'[\d.]+')
m = rel_re.match(release)
if m: