(file: Union[str, Path])
| 535 | |
| 536 | |
| 537 | async def async_readfile(file: Union[str, Path]) -> bytes: |
| 538 | def inner() -> bytes: |
| 539 | with open(file, "rb") as fh: |
| 540 | return fh.read() |
| 541 | |
| 542 | loop = asyncio.get_running_loop() |
| 543 | return await loop.run_in_executor(None, inner) |
| 544 | |
| 545 | |
| 546 | T = TypeVar("T") |
no outgoing calls
no test coverage detected