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.
"""Internal support module for sre"""
import _sre, sys
-
+import sre_parse
from sre_constants import *
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
# internal: convert pattern list to internal format
if isstring(p):
- import sre_parse
pattern = p
p = sre_parse.parse(p, flags)
else:
# some extra thread-state tests driven via _testcapi
def TestThreadState():
- import thread
- import time
-
if test_support.verbose:
print "auto-thread-state"
have_thread_state = False
if have_thread_state:
+ import thread
+ import time
TestThreadState()
import threading
t=threading.Thread(target=TestThreadState)