summaryrefslogtreecommitdiffstats
path: root/Lib/sre.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/sre.py')
-rw-r--r--Lib/sre.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/sre.py b/Lib/sre.py
index ffe2bc3..0ff70dc 100644
--- a/Lib/sre.py
+++ b/Lib/sre.py
@@ -215,7 +215,8 @@ def _join(seq, sep):
def _compile(*key):
# internal: compile pattern
- p = _cache.get(key)
+ cachekey = (type(key[0]),) + key
+ p = _cache.get(cachekey)
if p is not None:
return p
pattern, flags = key
@@ -229,7 +230,7 @@ def _compile(*key):
raise error, v # invalid expression
if len(_cache) >= _MAXCACHE:
_cache.clear()
- _cache[key] = p
+ _cache[cachekey] = p
return p
def _compile_repl(*key):