Skip to content

False alarms in libcst backend #174

@Zac-HD

Description

@Zac-HD
import trio

# Seems like the inner context manager 'hides' the checkpoint.
async def does_contain_checkpoints():
    with trio.fail_after(1):  # false-alarm TRIO100
        with trio.CancelScope():  # or any other context manager
            await trio.sleep_forever()

# -------------------------

async def elems():
    await trio.lowlevel.checkpoint()
    print("here")
    return ["elem1", "elem2"]

async def await_in_comp_target():
    return (print(x) for x in await elems())  # false-alarm TRIO910

trio.run(await_in_comp_target)  # prints "here", although not any elements

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions