mirror of
https://github.com/Kozea/Radicale.git
synced 2025-04-05 06:07:35 +03:00
Change type of stack_frame to Optional[...]
This commit is contained in:
parent
52ae129830
commit
dc3a733f04
1 changed files with 3 additions and 3 deletions
|
@ -30,7 +30,7 @@ import signal
|
||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
from types import FrameType
|
from types import FrameType
|
||||||
from typing import List, cast
|
from typing import List, Optional, cast
|
||||||
|
|
||||||
from radicale import VERSION, config, log, server, storage, types
|
from radicale import VERSION, config, log, server, storage, types
|
||||||
from radicale.log import logger
|
from radicale.log import logger
|
||||||
|
@ -49,7 +49,7 @@ def run() -> None:
|
||||||
# (like destructors, try-finish etc.), otherwise the process exits
|
# (like destructors, try-finish etc.), otherwise the process exits
|
||||||
# without running any of them
|
# without running any of them
|
||||||
def exit_signal_handler(signal_number: int,
|
def exit_signal_handler(signal_number: int,
|
||||||
stack_frame: FrameType) -> None:
|
stack_frame: Optional[FrameType]) -> None:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
for signal_number in exit_signal_numbers:
|
for signal_number in exit_signal_numbers:
|
||||||
signal.signal(signal_number, exit_signal_handler)
|
signal.signal(signal_number, exit_signal_handler)
|
||||||
|
@ -188,7 +188,7 @@ def run() -> None:
|
||||||
|
|
||||||
# Shutdown server when signal arrives
|
# Shutdown server when signal arrives
|
||||||
def shutdown_signal_handler(signal_number: int,
|
def shutdown_signal_handler(signal_number: int,
|
||||||
stack_frame: FrameType) -> None:
|
stack_frame: Optional[FrameType]) -> None:
|
||||||
shutdown_socket.close()
|
shutdown_socket.close()
|
||||||
for signal_number in exit_signal_numbers:
|
for signal_number in exit_signal_numbers:
|
||||||
signal.signal(signal_number, shutdown_signal_handler)
|
signal.signal(signal_number, shutdown_signal_handler)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue