diff options
author | Helmut Grohne <helmut@subdivi.de> | 2025-05-21 22:00:36 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2025-05-21 22:00:36 +0200 |
commit | ba7f822b1283d50432ec448563212d860c079c45 (patch) | |
tree | 4a49edae42f8e7547534cf25fb60812cc24b85a1 | |
parent | cf9a72045965f1a0ccc00f78d881c0c7cbf04171 (diff) | |
download | python-linuxnamespaces-ba7f822b1283d50432ec448563212d860c079c45.tar.gz |
fix type checking on mypy/1.15
-rw-r--r-- | linuxnamespaces/syscalls.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/linuxnamespaces/syscalls.py b/linuxnamespaces/syscalls.py index be0a5f7..9528b07 100644 --- a/linuxnamespaces/syscalls.py +++ b/linuxnamespaces/syscalls.py @@ -26,17 +26,17 @@ LIBC_SO = ctypes.CDLL(None, use_errno=True) if typing.TYPE_CHECKING: - CData = ctypes._CData # pylint: disable=protected-access + CDataType = ctypes._CDataType # pylint: disable=protected-access else: - CData = typing.Any + CDataType = typing.Any def _pad_fields( - fields: list[tuple[str, type[CData]]], + fields: list[tuple[str, type[CDataType]]], totalsize: int, name: str, - padtype: type[CData] = ctypes.c_uint8, -) -> list[tuple[str, type[CData]]]: + padtype: type[CDataType] = ctypes.c_uint8, +) -> list[tuple[str, type[CDataType]]]: """Append a padding element to a ctypes.Structure _fields_ sequence such that its total size matches a given value. """ @@ -560,7 +560,7 @@ class EventFD: """Return True unless the eventfd is closed.""" return self.fd >= 0 - def __enter__(self) -> "EventFD": + def __enter__(self) -> typing.Self: """When used as a context manager, the EventFD is closed on scope exit. """ return self @@ -847,7 +847,7 @@ class SignalFD: """Return True unless the signalfd is closed.""" return self.fd >= 0 - def __enter__(self) -> "EventFD": + def __enter__(self) -> typing.Self: """When used as a context manager, the SignalFD is closed on scope exit. """ |