mirror of
https://github.com/python/cpython.git
synced 2025-08-17 15:21:26 +00:00
Merged revisions 82766 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k Since 'purge' is an API change, modified it to be _purge for 2.x and deleted the doc update. ........ r82766 | r.david.murray | 2010-07-10 09:52:13 -0400 (Sat, 10 Jul 2010) | 5 lines Fix 'refleak' introduced by fnmatch cache purge tests. This introduces a 'purge' function for the fnmatch module analogous to the 'purge' function in the re module. ........
This commit is contained in:
parent
94f071c715
commit
2ab02f0e16
2 changed files with 10 additions and 1 deletions
|
@ -12,11 +12,15 @@ corresponding to PATTERN. (It does not compile it.)
|
|||
|
||||
import re
|
||||
|
||||
__all__ = ["filter", "fnmatch","fnmatchcase","translate"]
|
||||
__all__ = ["filter", "fnmatch", "fnmatchcase", "translate"]
|
||||
|
||||
_cache = {}
|
||||
_MAXCACHE = 100
|
||||
|
||||
def _purge():
|
||||
"""Clear the pattern cache"""
|
||||
_cache.clear()
|
||||
|
||||
def fnmatch(name, pat):
|
||||
"""Test whether FILENAME matches PATTERN.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue