mirror of https://github.com/mahmoud/boltons.git
my most commonly used signal handler, great for getting at anything that has an infinite loop (intentional or not)
This commit is contained in:
parent
af6b04531e
commit
8d022898d7
|
@ -0,0 +1,14 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
def pdb_on_signal(signal=None):
|
||||||
|
import pdb
|
||||||
|
import signal
|
||||||
|
if not signal:
|
||||||
|
signal = signal.SIGINT
|
||||||
|
|
||||||
|
def pdb_int_handler(sig, frame):
|
||||||
|
pdb.set_trace()
|
||||||
|
|
||||||
|
signal.signal(signal.SIGINT, pdb_int_handler)
|
||||||
|
return
|
Loading…
Reference in New Issue