(filename=None)
Discard cache entries that are out of date.
    (This is not checked upon each call!)
Discard cache entries that are out of date.
    (This is not checked upon each call!)
Discard cache entries that are out of date . ( This is not checked upon each call! )
def checkcache(filename=None):
    """Discard cache entries that are out of date.
    (This is not checked upon each call!)"""

    if filename is None:
        filenames = list(cache.keys())
    elif filename in cache:
        filenames = [filename]
    else:
        return

    for filename in filenames:
        entry = cache[filename]
        if len(entry) == 1:
            # lazy cache entry, leave it lazy.
            continue
        size, mtime, lines, fullname = entry
        if mtime is None:
            continue   # no-op for files loaded via a __loader__
        try:
            stat = os.stat(fullname)
        except OSError:
            cache.pop(filename, None)
            continue
        if size != stat.st_size or mtime != stat.st_mtime:
            cache.pop(filename, None)
def checkcache ( filename = None ) : if filename is None : filenames = list ( cache . keys ( ) ) elif filename in cache : filenames = [ filename ] else : return for filename in filenames : entry = cache [ filename ] if len ( entry ) == 1 : # lazy cache entry, leave it lazy. continue size , mtime , lines , fullname = entry if mtime is None : continue # no-op for files loaded via a __loader__ try : stat = os . stat ( fullname ) except OSError : cache . pop ( filename , None ) continue if size != stat . st_size or mtime != stat . st_mtime : cache . pop ( filename , None )