diff options
author | Devaev Maxim <[email protected]> | 2020-10-13 14:55:08 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-10-13 14:55:08 +0300 |
commit | 6420bc4533490af85a33d026c120d28a7f55a044 (patch) | |
tree | 6b787e07eef6d5de3a2b6058d70615eabb0a97c0 /kvmd/aiofs.py | |
parent | c6524fc7ac3a271a91fef994a9a9529940337596 (diff) |
mypy again
Diffstat (limited to 'kvmd/aiofs.py')
-rw-r--r-- | kvmd/aiofs.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/kvmd/aiofs.py b/kvmd/aiofs.py index c7bbd10d..53188286 100644 --- a/kvmd/aiofs.py +++ b/kvmd/aiofs.py @@ -29,7 +29,12 @@ from . import aiotools # ===== +async def read(path: str) -> str: + async with aiofiles.open(path) as afile: # type: ignore + return (await afile.read()) + + async def afile_write_now(afile: aiofiles.base.AiofilesContextManager, data: bytes) -> None: - await afile.write(data) - await afile.flush() - await aiotools.run_async(os.fsync, afile.fileno()) + await afile.write(data) # type: ignore + await afile.flush() # type: ignore + await aiotools.run_async(os.fsync, afile.fileno()) # type: ignore |