From e2f359f814805285e7ece3c9edba2cc93c958540 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 11 Jun 2024 22:40:29 +0200 Subject: improve typing linuxnamespaces/__init__.py: * linuxnamespaces.filedescriptor only exports FileDescriptor. By importing *, we re-export it implicitly. linuxnamespaces/atlocation.py: * PathLike should be parameterized and we no longer allow bytes there. linuxnamespaces/tarutils.py: * Resolve dict vs Mapping. tests/test_simple.py: * Establish expected type to mypy. examples/unschroot.py: * pidfd is first an int and later a FileDescriptor, but we always use it as int. * Also tell mypy that we cannot get NULL from waitid. --- linuxnamespaces/atlocation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linuxnamespaces/atlocation.py') diff --git a/linuxnamespaces/atlocation.py b/linuxnamespaces/atlocation.py index 8a38650..20d402a 100644 --- a/linuxnamespaces/atlocation.py +++ b/linuxnamespaces/atlocation.py @@ -21,7 +21,7 @@ from .filedescriptor import FileDescriptor AT_FDCWD = FileDescriptor(-100) -PathConvertible = typing.Union[str, os.PathLike] +PathConvertible = typing.Union[str, os.PathLike[str]] class AtFlags(enum.IntFlag): -- cgit v1.2.3