8000 Code cleanup · gitpython-developers/async@4c42ae3 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit 4c42ae3

Browse files
committed
Code cleanup
This includes removing the custom zlib module which just caused maintenance effort without actually being useful. Made entire codebase linter compatible. However, py3 still shows some errors, whose fix should be easy enough
1 parent 01950b0 commit 4c42ae3

17 files changed

+54
-1431
lines changed

async/__init__.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,7 @@
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55
"""Initialize the multi-processing package"""
66

7-
#{ Initialization
8-
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-
from . import thread
13-
atexit.register(thread.do_terminate_threads)
14-
15- 8000
def _init_signals():
16-
"""Assure we shutdown our threads correctly when being interrupted"""
17-
import signal
18-
from . 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 isinstance(prev_handler, collections.Callable):
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-
sys.stderr.write("Failed to setup thread-interrupt handler. This is usually not critical")
34-
# END exception handling
35-
36-
37-
#} END init
38-
39-
_init_atexit()
40-
_init_signals()
41-
42-
437
# initial imports
448
from .task import *
459
from .pool import *
4610
from .channel import *
47-
import collections

async/channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import threading
2525
import sys
2626

27-
__all__ = ('Channel', 'SerialChannel', 'Writer', 'ChannelWriter', 'CallbackChannelWriter',
27+
__all__ = ( 'Channel', 'SerialChannel', 'Writer', 'ChannelWriter', 'CallbackChannelWriter',
2828
'Reader', 'ChannelReader', 'CallbackChannelReader', 'mkchannel', 'ReadOnly',
2929
'IteratorReader', 'CallbackReaderMixin', 'CallbackWriterMixin')
3030

async/mod/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0