Breakpoints set from Python Breakpoints packages did not work

I just installed sublime text 2, control package and python breakpoints. Well, I'm trying to use the breakpoint functionality of these packages, but it doesn't work. I am using Ubuntu 14.04.2 LTS.

This is just test code

import pdb; pdb.set_trace()  
p = 'Hello World'
print p

      

When I run it, the follwing output is thrown:

> /home/teste.py(5)<module>()
-> p = 'Hellow World'
(Pdb) Traceback (most recent call last):
  File "/home/teste.py", line 5, in <module>
    p = 'Hellow World'
  File "/home/teste.py", line 5, in <module>
    p = 'Hellow World'
  File "/usr/lib/python2.7/bdb.py", line 49, in trace_dispatch
    return self.dispatch_line(frame)
  File "/usr/lib/python2.7/bdb.py", line 68, in dispatch_line
    if self.quitting: raise BdbQuit
bdb.BdbQuit

      

I will be glad for any help.

+3


source to share


1 answer


Just answer this question:

It seems like Sublime Text doesn't support any kind of REPL . The checkpoint above works, but exits with an exception thrown BdbQuit

when the pdb REPL gets EOF , which is the usual way to "exit" (also works on bash, zsh, python interpreter, etc.). Apparently Sublime Text sends this immediately as it cannot open the REPL.

Non-commercial solution

Just don't run your code with Sublime Text. Activating this breakpoint, either through the command line ( python my_script.py

) or through the Python interpreter (by importing and running) will actually take you to the pdb interpreter as expected.



Integrated solution

There are several projects (like this one I mentioned in the comments above) that can add REPL support for Sublime. I personally don't use Sublime Text, so I can't recommend it, and I don't even know if it's a good thing.

Should any Exalted Experts come up, please feel free to improve this answer or suggest alternatives in the comments.

+1


source







All Articles