gaogaotiantian / watchpoints

watchpoints is an easy-to-use, intuitive variable/object monitor tool for python that behaves similar to watchpoints in gdb.
Apache License 2.0
497 stars 20 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '<stdin>' #10

Closed youssefavx closed 3 years ago

youssefavx commented 3 years ago

When I run the first example in the terminal:

from watchpoints import watch
a = 0
watch(a)

I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/watchpoints/watch.py", line 28, in __call__
    argnodes = getargnodes(frame)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/watchpoints/util.py", line 43, in getargnodes
    line = getline(frame)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/watchpoints/util.py", line 19, in getline
    with open(filename, "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '<stdin>'
youssefavx commented 3 years ago

Sorry just realized this only works for files (makes sense)

gaogaotiantian commented 3 years ago

@youssefavx watchpoints works with REPL now.