Skip to content

Multi-line edit executes too early with await #13424

@cdeil

Description

@cdeil

I was trying to type this example in IPython:

from prefect.client import OrionClient

async with OrionClient() as client:
    deployment = await client.read_deployment_by_name("Addition Machine/my-first-deployment")
    flow_run = await client.create_flow_run_from_deployment(deployment)

However, typing ENTER after the first line with an await statement stops the multi-line edit too soon and executes the code:

In [16]: async with OrionClient() as client:
    ...:     deployment = await client.read_deployment_by_name("Addition Machine/my-first-deployment")

In [17]:

I think this is a general bug with await, the same bug happens with any other example, e.g.

In [17]: with open():
    ...:     spam = await Thing()

@minrk - related to #13348 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions