donkirkby / live-py-plugin

Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
https://donkirkby.github.io/live-py-plugin
MIT License
290 stars 57 forks source link

Empty source file #538

Closed donkirkby closed 1 year ago

donkirkby commented 1 year ago

What I did

Ran space_tracer on an empty file.

$ space_tracer /dev/null

What happened

Error raised.

$ space_tracer /dev/null 
Traceback (most recent call last):
  File "/home/don/workspace/venv/bin/space_tracer", line 8, in <module>
    sys.exit(main())
  File "/home/don/workspace/venv/lib/python3.10/site-packages/space_tracer/main.py", line 176, in main
    code_report = tracer.trace_command()
  File "/home/don/workspace/venv/lib/python3.10/site-packages/space_tracer/main.py", line 548, in trace_command
    last_line = max(last for first, last in source_blocks)
ValueError: max() arg is an empty sequence
$

What I wanted to happen

Empty result.

$ space_tracer /dev/null 
$

My environment

Describe the versions of everything you were using: