◐ Shell
clean mode source ↗

[3.7] issue-25872: Fix KeyError using linecache from multiple threads (GH-18007) by miss-islington · Pull Request #20080 · python/cpython

Expand Up @@ -73,10 +73,10 @@ def checkcache(filename=None): try: stat = os.stat(fullname) except OSError: del cache[filename] cache.pop(filename, None) continue if size != stat.st_size or mtime != stat.st_mtime: del cache[filename] cache.pop(filename, None)

def updatecache(filename, module_globals=None): Expand All @@ -86,7 +86,7 @@ def updatecache(filename, module_globals=None):
if filename in cache: if len(cache[filename]) != 1: del cache[filename] cache.pop(filename, None) if not filename or (filename.startswith('<') and filename.endswith('>')): return []
Expand Down