Fix bug with empty source

This commit is contained in:
Ram Rachum 2019-08-28 20:31:16 +03:00
parent 4eb2db6514
commit a1517196e1

View file

@ -80,7 +80,9 @@ def get_path_and_source_from_frame(frame):
source = fp.read().splitlines()
except utils.file_reading_errors:
pass
if source is None:
if not source:
# We used to check `if source is None` but I found a rare bug where it
# was empty, but not `None`, so now we check `if not source`.
source = UnavailableSource()
# If we just read the source from a file, or if the loader did not