Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Lib/fnmatch.py

    r2 r388  
    1313import re
    1414
    15 __all__ = ["filter", "fnmatch","fnmatchcase","translate"]
     15__all__ = ["filter", "fnmatch", "fnmatchcase", "translate"]
    1616
    1717_cache = {}
     18_MAXCACHE = 100
     19
     20def _purge():
     21    """Clear the pattern cache"""
     22    _cache.clear()
    1823
    1924def fnmatch(name, pat):
     
    4550    if not pat in _cache:
    4651        res = translate(pat)
     52        if len(_cache) >= _MAXCACHE:
     53            _cache.clear()
    4754        _cache[pat] = re.compile(res)
    4855    match=_cache[pat].match
     
    6774    if not pat in _cache:
    6875        res = translate(pat)
     76        if len(_cache) >= _MAXCACHE:
     77            _cache.clear()
    6978        _cache[pat] = re.compile(res)
    7079    return _cache[pat].match(name) is not None
Note: See TracChangeset for help on using the changeset viewer.