I'm currently trying to debug memory usage of a python flask program, and I'm able to run the program in PDB by adding:
import pdb
pdb.set_trace()
At the entry point of my server. Then I tell PDB to continue and run the program.
I've read that by doing Ctrl-C, I can pause a program running in PDB, but it appears Flask is catching the KeyboardInterrupt
exception:
^CKeyboardInterrupt
Traceback (most recent call last):
File "./server.py", line 4, in <module>
from mauie.defaults import *
File "/lib/python2.7/site-packages/flask_socketio/__init__.py", line 414, in run
File "/lib/python2.7/site-packages/gevent/baseserver.py", line 284, in serve_forever
File "/lib/python2.7/site-packages/gevent/event.py", line 77, in wait
File "/lib/python2.7/site-packages/gevent/hub.py", line 338, in switch
KeyboardInterrupt
But the PDB prompt never comes up.