Skip to content

Commit

Permalink
Fix async functions should not call open()
Browse files Browse the repository at this point in the history
% [`ruff --select=ASYNC .`](https://beta.ruff.rs/docs/rules/open-sleep-or-subprocess-in-async-function)
2	ASYNC101	[ ] Async functions should not call `open`, `time.sleep`, or `subprocess` methods
  • Loading branch information
cclauss committed Jul 23, 2023
1 parent 9721c65 commit 70a1413
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/bench-asyncio-write.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ async def bench(job_title, w, body, base=None):
base = await bench(t, writes[0], c)
for w in writes[1:]:
await bench("", w, c, base)
with open("bench.md", "w") as f:
for line in res:
f.write("| {} |\n".format(" | ".join(line)))
return res


loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))
results = loop.run_until_complete(main(loop))
with open("bench.md", "w") as f:
for line in results:
f.write("| {} |\n".format(" | ".join(line)))

0 comments on commit 70a1413

Please sign in to comment.