(file: Union[str, Path], data: Union[str, bytes])
| 526 | |
| 527 | |
| 528 | async def async_writefile(file: Union[str, Path], data: Union[str, bytes]) -> None: |
| 529 | def inner() -> None: |
| 530 | with open(file, "w" if isinstance(data, str) else "wb") as fh: |
| 531 | fh.write(data) |
| 532 | |
| 533 | loop = asyncio.get_running_loop() |
| 534 | await loop.run_in_executor(None, inner) |
| 535 | |
| 536 | |
| 537 | async def async_readfile(file: Union[str, Path]) -> bytes: |
no outgoing calls
no test coverage detected