From e600ebb412c31f84f0adda4ce50d0802fe179fea Mon Sep 17 00:00:00 2001 From: Allison Karlitskaya Date: Fri, 1 Sep 2023 10:49:54 +0200 Subject: [PATCH] transports: fixes for mypy --strict --- src/cockpit/transports.py | 4 ++-- test/static-code | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cockpit/transports.py b/src/cockpit/transports.py index 082d79dce745..e6cb0b733923 100644 --- a/src/cockpit/transports.py +++ b/src/cockpit/transports.py @@ -36,7 +36,7 @@ libc6 = ctypes.cdll.LoadLibrary('libc.so.6') -def prctl(*args): +def prctl(*args: int) -> None: if libc6.prctl(*args) != 0: raise OSError('prctl() failed') @@ -349,7 +349,7 @@ def __init__(self, **kwargs: Any): # go down as a team -- we don't want any leaked processes when the bridge terminates - def preexec_fn(): + def preexec_fn() -> None: prctl(SET_PDEATHSIG, signal.SIGTERM) if pty: fcntl.ioctl(0, termios.TIOCSCTTY, 0) diff --git a/test/static-code b/test/static-code index 36b9e60257b2..775dd8a2ca1b 100755 --- a/test/static-code +++ b/test/static-code @@ -48,6 +48,7 @@ if [ "${WITH_PARTIAL_TREE:-0}" = 0 ]; then src/cockpit/_version.py src/cockpit/jsonutil.py src/cockpit/protocol.py + src/cockpit/transports.py ' test_mypy() { command -v mypy >/dev/null || skip 'no mypy'