--- theano/gof/utils.py.orig 2020-12-14 05:42:43.000000000 -0700
+++ theano/gof/utils.py 2021-06-08 12:45:23.976560620 -0600
@@ -42,7 +42,7 @@ def simple_extract_stack(f=None, limit=N
filename = co.co_filename
name = co.co_name
# linecache.checkcache(filename)
- line = linecache.getline(filename, lineno, f.f_globals)
+ line = linecache.getline(filename, lineno, f.f_globals) if lineno else None
if line:
line = line.strip()
else: