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)
| 30 | |
| 31 | |
| 32 | def getlines(filename, module_globals=None): |
| 33 | """Get the lines for a Python source file from the cache. |
| 34 | Update the cache if it doesn't contain an entry for this file already.""" |
| 35 | |
| 36 | entry = cache.get(filename, None) |
| 37 | if entry is not None and len(entry) != 1: |
| 38 | return entry[2] |
| 39 | |
| 40 | try: |
| 41 | return updatecache(filename, module_globals) |
| 42 | except MemoryError: |
| 43 | clearcache() |
| 44 | return [] |
| 45 | |
| 46 | |
| 47 | def _getline_from_code(filename, lineno): |
searching dependent graphs…