diff options
author | Helmut Grohne <helmut@subdivi.de> | 2025-05-21 22:34:37 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2025-05-21 22:34:37 +0200 |
commit | 58af839d8f7b47aea2c4ab37f2b5e168c03a3bb0 (patch) | |
tree | 93f272a456cdc4c039dd24c3a24a9ef8d827da60 | |
parent | 29ef6690e5ae0433821995c89ae682ad0fa7f80d (diff) | |
download | python-linuxnamespaces-58af839d8f7b47aea2c4ab37f2b5e168c03a3bb0.tar.gz |
agree a bit with black's formatting recommendations
-rw-r--r-- | linuxnamespaces/__init__.py | 1 | ||||
-rw-r--r-- | linuxnamespaces/filedescriptor.py | 3 | ||||
-rw-r--r-- | tests/test_simple.py | 20 |
3 files changed, 16 insertions, 8 deletions
diff --git a/linuxnamespaces/__init__.py b/linuxnamespaces/__init__.py index 9332a06..0392276 100644 --- a/linuxnamespaces/__init__.py +++ b/linuxnamespaces/__init__.py @@ -628,6 +628,7 @@ def unshare_user_idmap( unshare(flags) setup_idmaps() + def unshare_user_idmap_nohelper( uid: int, gid: int, flags: CloneFlags = CloneFlags.NEWUSER ) -> None: diff --git a/linuxnamespaces/filedescriptor.py b/linuxnamespaces/filedescriptor.py index ea699c2..f9460bf 100644 --- a/linuxnamespaces/filedescriptor.py +++ b/linuxnamespaces/filedescriptor.py @@ -10,8 +10,7 @@ import typing @typing.runtime_checkable class HasFileno(typing.Protocol): - def fileno(self) -> int: - ... + def fileno(self) -> int: ... FileDescriptorLike = int | HasFileno diff --git a/tests/test_simple.py b/tests/test_simple.py index 07a0740..2b5252f 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -126,9 +126,13 @@ class AsnycioTest(unittest.IsolatedAsyncioTestCase): async def test_copyfd_file_sock(self) -> None: sock1, sock2 = socket.socketpair() - with sock1, sock2, linuxnamespaces.FileDescriptor( - os.open("/etc/passwd", os.O_RDONLY) - ) as rfd: + with ( + sock1, + sock2, + linuxnamespaces.FileDescriptor( + os.open("/etc/passwd", os.O_RDONLY) + ) as rfd, + ): fut = asyncio.ensure_future( linuxnamespaces.async_copyfd(rfd, sock1.fileno(), 999) ) @@ -139,9 +143,13 @@ class AsnycioTest(unittest.IsolatedAsyncioTestCase): async def test_copyfd_file_pipe(self) -> None: rfdp, wfdp = linuxnamespaces.FileDescriptor.pipe(blocking=False) - with rfdp, wfdp, linuxnamespaces.FileDescriptor( - os.open("/etc/passwd", os.O_RDONLY) - ) as rfd: + with ( + rfdp, + wfdp, + linuxnamespaces.FileDescriptor( + os.open("/etc/passwd", os.O_RDONLY) + ) as rfd, + ): fut = asyncio.ensure_future( linuxnamespaces.async_copyfd(rfd, wfdp, 999) ) |