Skip to content

ASYNC115 (async-zero-sleep): anyio.lowlevel.checkpoint() needs import anyio.lowlevel #21693

@injust

Description

@injust

Summary

import anyio

async def test() -> None:
    await anyio.sleep(0)

https://play.ruff.rs/86a8f945-5295-4092-ae43-81de88b90a63

ASYNC115 auto-fixes this to:

import anyio

async def test() -> None:
    await anyio.lowlevel.checkpoint()

This doesn't type check because anyio.lowlevel isn't imported.

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions