File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
77### Added
88- Call ` disconnect() ` method.
99
10+ ### Fixed
11+ - Check signals supported by the environment. On Windows there is no ` SIGHUP ` .
12+
1013## [ 2.0.0rc1] - 2019-10-28
1114### Added
1215- Support for Calling ` tap ` , ` tap_async ` methods.
Original file line number Diff line number Diff line change @@ -112,9 +112,15 @@ async def cancel_pending_tasks(self):
112112 [task .cancel () for task in tasks ]
113113 await asyncio .gather (* tasks , return_exceptions = True )
114114
115+ def handle_signal (self ):
116+ asyncio .create_task (self .disconnect ())
117+
115118 def attach_signals (self ):
116- for s in (signal .SIGHUP , signal .SIGTERM , signal .SIGINT ):
117- self .loop .add_signal_handler (s , lambda : asyncio .create_task (self .disconnect ()))
119+ for s in ('SIGHUP' , 'SIGTERM' , 'SIGINT' ):
120+ try :
121+ self .loop .add_signal_handler (getattr (signal , s ), self .handle_signal )
122+ except :
123+ pass
118124
119125 async def on_socket_open (self ):
120126 try :
You can’t perform that action at this time.
0 commit comments