MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getlines

Function getlines

tools/python-3.11.9-amd64/Lib/linecache.py:36–49  ·  view source on GitHub ↗

Get the lines for a Python source file from the cache. Update the cache if it doesn't contain an entry for this file already.

(filename, module_globals=None)

Source from the content-addressed store, hash-verified

34
35
36def getlines(filename, module_globals=None):
37 """Get the lines for a Python source file from the cache.
38 Update the cache if it doesn't contain an entry for this file already."""
39
40 if filename in cache:
41 entry = cache[filename]
42 if len(entry) != 1:
43 return cache[filename][2]
44
45 try:
46 return updatecache(filename, module_globals)
47 except MemoryError:
48 clearcache()
49 return []
50
51
52def checkcache(filename=None):

Callers 2

getlineFunction · 0.85

Calls 2

updatecacheFunction · 0.85
clearcacheFunction · 0.85

Tested by 1