##// END OF EJS Templates
showstack: also handle SIGALRM...
Augie Fackler -
r40072:acf5dbe3 default
parent child Browse files
Show More
@@ -4,7 +4,7 b''
4 4 """dump stack trace when receiving SIGQUIT (Ctrl-\) and SIGINFO (Ctrl-T on BSDs)
5 5 """
6 6
7 from __future__ import absolute_import
7 from __future__ import absolute_import, print_function
8 8 import signal
9 9 import sys
10 10 import traceback
@@ -14,8 +14,14 b' def sigshow(*args):'
14 14 traceback.print_stack(args[1], limit=10, file=sys.stderr)
15 15 sys.stderr.write("----\n")
16 16
17 def sigexit(*args):
18 sigshow(*args)
19 print('alarm!')
20 sys.exit(1)
21
17 22 def extsetup(ui):
18 23 signal.signal(signal.SIGQUIT, sigshow)
24 signal.signal(signal.SIGALRM, sigexit)
19 25 try:
20 26 signal.signal(signal.SIGINFO, sigshow)
21 27 except AttributeError:
General Comments 0
You need to be logged in to leave comments. Login now