import pdb, threading def foo(): pdb.set_trace() lineno = 5 lineno = 6 t = threading.Thread(target=foo, name='fooThread') t.start() t.join()