-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
Hello,
with the recent updates ruff started to complain on following snippet of code:
import asyncio
async def main() -> None:
input("sync")
await asyncio.to_thread(lambda: input("async"))
if __name__ == '__main__':
asyncio.run(main())$ ruff check --select=ASYNC250 async.py
ASYNC250 Blocking call to `input()` in async context
--> async.py:6:5
|
5 | async def main() -> None:
6 | input("sync")
| ^^^^^
7 | await asyncio.to_thread(lambda: input("async"))
|
ASYNC250 Blocking call to `input()` in async context
--> async.py:7:37
|
5 | async def main() -> None:
6 | input("sync")
7 | await asyncio.to_thread(lambda: input("async"))
| ^^^^^
|
Found 2 errors.for comparison flake8-async passes "async" invocation:
$ flake8 --enable=ASYNC250 async.py
async.py:6:5: ASYNC250 Blocking sync call `input()` in async function. Wrap in `asyncio.loop.run_in_executor`.Version
ruff 0.15.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule