summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-08 21:27:42 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-08 21:27:42 (GMT)
commit4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224 (patch)
tree2f6d90495b0810238db4e2093acc1536c7b270c7 /Lib/sre_compile.py
parentabf8e015c2cd0af1c463eccf371bba003ae538dd (diff)
downloadcpython-4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224.zip
cpython-4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224.tar.gz
cpython-4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224.tar.bz2
Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
suite as a side-effect of importing the module. - in test_capi, a thread tried to import other modules - re.compile() imported sre_parse again on every call.
Diffstat (limited to 'Lib/sre_compile.py')
-rw-r--r--Lib/sre_compile.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 22ab2fd..65d2ccf 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -11,7 +11,7 @@
"""Internal support module for sre"""
import _sre, sys
-
+import sre_parse
from sre_constants import *
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
@@ -502,7 +502,6 @@ def compile(p, flags=0):
# internal: convert pattern list to internal format
if isstring(p):
- import sre_parse
pattern = p
p = sre_parse.parse(p, flags)
else: