From c27648e8ab2e0301a7ba5e519322fb5d3af01b4c Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 20 May 2025 08:18:40 +0200 Subject: syscalls.py: help old mypy in better understanding sigval --- linuxnamespaces/syscalls.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linuxnamespaces/syscalls.py b/linuxnamespaces/syscalls.py index 604135e..f6af348 100644 --- a/linuxnamespaces/syscalls.py +++ b/linuxnamespaces/syscalls.py @@ -868,12 +868,12 @@ def sigqueue( pid: int, sig: signal.Signals, value: int | ctypes.c_void_p | None = None ) -> None: """Python wrapper for sigqueue(2).""" - sigval = _SigqueueSigval() - if value is not None: - if isinstance(value, int): - sigval.sival_int = value - else: - sigval.sival_ptr = value + if value is None: + sigval = _SigqueueSigval() + elif isinstance(value, int): + sigval = _SigqueueSigval(sival_int=value) + else: + sigval = _SigqueueSigval(sival_ptr=value) call_libc("sigqueue", pid, int(sig), sigval) -- cgit v1.2.3