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 5
5
that name.
6
6
"""
7
7
8
- import functools
9
8
import sys
10
9
import os
11
- import tokenize
12
10
13
11
__all__ = ["getline" , "clearcache" , "checkcache" , "lazycache" ]
14
12
@@ -82,6 +80,8 @@ def updatecache(filename, module_globals=None):
82
80
If something's wrong, print a message, discard the cache entry,
83
81
and return an empty list."""
84
82
83
+ import tokenize
84
+
85
85
if filename in cache :
86
86
if len (cache [filename ]) != 1 :
87
87
cache .pop (filename , None )
@@ -176,7 +176,8 @@ def lazycache(filename, module_globals):
176
176
get_source = getattr (loader , 'get_source' , None )
177
177
178
178
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 )
180
181
cache [filename ] = (get_lines ,)
181
182
return True
182
183
return False
You can’t perform that action at this time.
0 commit comments