mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 10:01:53 +08:00
mypy again
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user