mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-07-20 01:44:10 +00:00
Fix bug with empty source
This commit is contained in:
parent
4eb2db6514
commit
a1517196e1
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue