diff options
author | Hye-Shik Chang <hyeshik@gmail.com> | 2004-04-20 21:11:11 (GMT) |
---|---|---|
committer | Hye-Shik Chang <hyeshik@gmail.com> | 2004-04-20 21:11:11 (GMT) |
commit | 0f5bf1ebdd426fb17f92d00b319a55b014021c30 (patch) | |
tree | 029762db31287daade4951c75dada746b19e3bb5 | |
parent | 1660e0c1f162efcc2a19e07ca87193e071bca311 (diff) | |
download | cpython-0f5bf1ebdd426fb17f92d00b319a55b014021c30.zip cpython-0f5bf1ebdd426fb17f92d00b319a55b014021c30.tar.gz cpython-0f5bf1ebdd426fb17f92d00b319a55b014021c30.tar.bz2 |
SF #926075: Fixed the bug that returns a wrong pattern object for
a string or unicode object in sre.compile() when a different type
pattern with the same value exists.
-rw-r--r-- | Lib/sre.py | 5 | ||||
-rw-r--r-- | Misc/NEWS | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -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): @@ -303,6 +303,10 @@ Extension modules Library ------- +- Bug #926075: Fixed a bug that returns a wrong pattern object + for a string or unicode object in sre.compile() when a different + type pattern with the same value exists. + - Added countcallers arg to trace.Trace class (--trackcalls command line arg when run from the command prompt). |