File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 55that name.
66"""
77
8- import functools
98import sys
109import os
11- import tokenize
1210
1311__all__ = ["getline" , "clearcache" , "checkcache" , "lazycache" ]
1412
@@ -82,6 +80,8 @@ def updatecache(filename, module_globals=None):
8280 If something's wrong, print a message, discard the cache entry,
8381 and return an empty list."""
8482
83+ import tokenize
84+
8585 if filename in cache :
8686 if len (cache [filename ]) != 1 :
8787 cache .pop (filename , None )
@@ -176,7 +176,8 @@ def lazycache(filename, module_globals):
176176 get_source = getattr (loader , 'get_source' , None )
177177
178178 if name and get_source :
179- get_lines = functools .partial (get_source , name )
179+ def get_lines (name = name , * args , ** kwargs ):
180+ return get_source (name , * args , ** kwargs )
180181 cache [filename ] = (get_lines ,)
181182 return True
182183 return False
You can’t perform that action at this time.
0 commit comments