forked from M-Labs/artiq
import_cache: read files only once
This commit is contained in:
parent
1ea3cf48d6
commit
95eb218112
|
@ -24,6 +24,7 @@ linecache_getlines = None
|
|||
def add_module_to_cache(module):
|
||||
if hasattr(module, "__file__"):
|
||||
fn = module.__file__
|
||||
if fn not in cache:
|
||||
try:
|
||||
with tokenize.open(fn) as fp:
|
||||
lines = fp.readlines()
|
||||
|
|
Loading…
Reference in New Issue