diff options
author | Helmut Grohne <helmut@subdivi.de> | 2025-05-20 08:18:40 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2025-05-20 08:18:40 +0200 |
commit | c27648e8ab2e0301a7ba5e519322fb5d3af01b4c (patch) | |
tree | fb8adba7d38ff7ca0a70a0035eee8d5ce8dea2a8 | |
parent | 96ed82b64ac4b0c680f529973a83e37af28c9748 (diff) | |
download | python-linuxnamespaces-c27648e8ab2e0301a7ba5e519322fb5d3af01b4c.tar.gz |
syscalls.py: help old mypy in better understanding sigval
-rw-r--r-- | linuxnamespaces/syscalls.py | 12 |
1 files 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) |