From: John Mulligan Date: Wed, 29 Mar 2023 14:15:10 +0000 (-0400) Subject: src/pybind: fix type annotations for signal handler function X-Git-Tag: v17.2.8~507^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0c834e99bdef246dcfb13a83a457d8c1cad07400;p=ceph.git src/pybind: fix type annotations for signal handler function This change makes this file pass mypy checking on mypy 0.981. Signed-off-by: John Mulligan (cherry picked from commit 3035ca6c52168245dcc2104ef58615948697e740) --- diff --git a/src/pybind/ceph_daemon.py b/src/pybind/ceph_daemon.py index f15af91e8ae25..0a70e92bc93a2 100644 --- a/src/pybind/ceph_daemon.py +++ b/src/pybind/ceph_daemon.py @@ -22,7 +22,7 @@ from prettytable import PrettyTable, HEADER from signal import signal, Signals, SIGWINCH from termios import TIOCGWINSZ from types import FrameType -from typing import Any, Callable, Dict, List, Optional, Sequence, TextIO, Tuple +from typing import Any, Callable, Dict, List, Optional, Sequence, TextIO, Tuple, Union from ceph_argparse import parse_json_funcsigs, validate_command @@ -367,8 +367,8 @@ class DaemonWatcher(object): raise RuntimeError("no stats selected by filters") def _handle_sigwinch(self, - signo: Signals, - frame: FrameType) -> None: + signo: Union[int, Signals], + frame: Optional[FrameType]) -> None: self.termsize.update() def run(self,