Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5714129

Browse files
committed
tabs to spaces
1 parent 039c1d5 commit 5714129

18 files changed

+2627
-2627
lines changed

async/__init__.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@
66

77
#{ Initialization
88
def _init_atexit():
9-
"""Setup an at-exit job to be sure our workers are shutdown correctly before
10-
the interpreter quits"""
11-
import atexit
12-
import thread
13-
atexit.register(thread.do_terminate_threads)
14-
9+
"""Setup an at-exit job to be sure our workers are shutdown correctly before
10+
the interpreter quits"""
11+
import atexit
12+
import thread
13+
atexit.register(thread.do_terminate_threads)
14+
1515
def _init_signals():
16-
"""Assure we shutdown our threads correctly when being interrupted"""
17-
import signal
18-
import thread
19-
import sys
20-
21-
prev_handler = signal.getsignal(signal.SIGINT)
22-
def thread_interrupt_handler(signum, frame):
23-
thread.do_terminate_threads()
24-
if callable(prev_handler):
25-
prev_handler(signum, frame)
26-
raise KeyboardInterrupt()
27-
# END call previous handler
28-
# END signal handler
29-
try:
30-
signal.signal(signal.SIGINT, thread_interrupt_handler)
31-
except ValueError:
32-
# happens if we don't try it from the main thread
33-
print >> sys.stderr, "Failed to setup thread-interrupt handler. This is usually not critical"
34-
# END exception handling
16+
"""Assure we shutdown our threads correctly when being interrupted"""
17+
import signal
18+
import thread
19+
import sys
20+
21+
prev_handler = signal.getsignal(signal.SIGINT)
22+
def thread_interrupt_handler(signum, frame):
23+
thread.do_terminate_threads()
24+
if callable(prev_handler):
25+
prev_handler(signum, frame)
26+
raise KeyboardInterrupt()
27+
# END call previous handler
28+
# END signal handler
29+
try:
30+
signal.signal(signal.SIGINT, thread_interrupt_handler)
31+
except ValueError:
32+
# happens if we don't try it from the main thread
33+
print >> sys.stderr, "Failed to setup thread-interrupt handler. This is usually not critical"
34+
# END exception handling
3535

3636

3737
#} END init

0 commit comments

Comments
 (0)