Skip to content

Commit

Permalink
transports: fixes for mypy --strict
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonkarlitskaya committed Sep 8, 2023
1 parent 1d8ac17 commit e600ebb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cockpit/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions test/static-code
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit e600ebb

Please sign in to comment.