]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/pybind: fix type annotations for signal handler function
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 29 Mar 2023 14:15:10 +0000 (10:15 -0400)
committerAfreen <afreen23.git@gmail.com>
Thu, 15 Feb 2024 08:28:18 +0000 (13:58 +0530)
This change makes this file pass mypy checking on mypy 0.981.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 3035ca6c52168245dcc2104ef58615948697e740)

src/pybind/ceph_daemon.py

index f15af91e8ae2544401000fc3e25f8622d67ffe2c..0a70e92bc93a29e4d4c9d1079a72715cf94ed8e3 100644 (file)
@@ -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,