diff -r 67714c4d9725 Lib/filecmp.py --- a/Lib/filecmp.py Mon Jun 10 23:02:56 2013 -0500 +++ b/Lib/filecmp.py Wed Jun 12 13:47:10 2013 +0100 @@ -6,6 +6,7 @@ Functions: cmp(f1, f2, shallow=True) -> int cmpfiles(a, b, common) -> ([], [], []) + clear_cache() """ @@ -21,6 +22,11 @@ DEFAULT_IGNORES = [ 'RCS', 'CVS', 'tags', '.git', '.hg', '.bzr', '_darcs', '__pycache__'] +def clear_cache(): + """Clear the filecmp cache + + """ + _cache.clear() def cmp(f1, f2, shallow=True): """Compare two files. @@ -39,7 +45,8 @@ True if the files are the same, False otherwise. This function uses a cache for past comparisons and the results, - with a cache invalidation mechanism relying on stale signatures. + with a cache invalidation mechanism relying on stale signatures + or by explicitly calling clear_cache() """