Skip to content

Commit 5345ac4

Browse files
committed
dsf
1 parent 9a9fba8 commit 5345ac4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/linecache.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
that name.
66
"""
77

8-
import functools
98
import sys
109
import 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

0 commit comments

Comments
 (0)