File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 3333type HandleableSignals = Literal ["SIGINT" , "SIGTERM" , "SIGBREAK" , "SIGHUP" ]
3434type SignalTuple = tuple [HandleableSignals , ...]
3535
36-
37- type _DEF = tuple [Literal ["SIGINT" ], Literal ["SIGTERM" ], Literal ["SIGBREAK" ]]
38- default_handled : Final [_DEF ] = "SIGINT" , "SIGTERM" , "SIGBREAK"
36+ default_handled : Final = "SIGINT" , "SIGTERM" , "SIGBREAK"
3937
4038
4139class SpecialExit (enum .IntEnum ):
@@ -44,15 +42,15 @@ class SpecialExit(enum.IntEnum):
4442 EXIT = 252
4543
4644
47- class SignalService [ T : SignalTuple ] :
45+ class SignalService :
4846 """Helper for signal handling.
4947
5048 Meant for graceful signal handling where the main thread is only used
5149 for signal handling.
5250 This should be paired with event loops being run in threads.
5351 """
5452
55- def __init__ (self , signals : T = default_handled , / ) -> None :
53+ def __init__ (self , signals : SignalTuple = default_handled , / ) -> None :
5654 self ._startup : list [StartStopCall ] = []
5755 self ._cbs : list [SignalCallback ] = []
5856 self ._joins : list [StartStopCall ] = []
You can’t perform that action at this time.
0 commit comments