diff --git a/Lib/linecache.py b/Lib/linecache.py index b97999fc1dc909c..0fcd91cfb589324 100644 --- a/Lib/linecache.py +++ b/Lib/linecache.py @@ -5,9 +5,6 @@ that name. """ -import sys -import os - __all__ = ["getline", "clearcache", "checkcache", "lazycache"] @@ -48,6 +45,7 @@ def getlines(filename, module_globals=None): def checkcache(filename=None): + import os """Discard cache entries that are out of date. (This is not checked upon each call!)""" @@ -76,6 +74,9 @@ def checkcache(filename=None): def updatecache(filename, module_globals=None): + import os + import sys + """Update a cache entry and return its list of lines. If something's wrong, print a message, discard the cache entry, and return an empty list."""