Skip to content

aio._AsyncioApi.resolve() must care for cancelled future #124

Description

@blinkingmatt

When setting the result for a Future object with Future.set_result() for a cancelled future we get an InvalidStateError.
So I would suggest a small addition in the resolve() method:

def resolve(self, future, result=None):
    if not future.cancelled():
        future.set_result(result)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions