summaryrefslogtreecommitdiffstats
path: root/Lib/linecache.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/linecache.py')
-rw-r--r--Lib/linecache.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py
index e505b03..884cbf4 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -37,8 +37,12 @@ def getlines(filename, module_globals=None):
if filename in cache:
return cache[filename][2]
- else:
+
+ try:
return updatecache(filename, module_globals)
+ except MemoryError:
+ clearcache()
+ return []
def checkcache(filename=None):