-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
In its current state, doubles's and_return_future only returns concurrent.futures.Future or tornado.concurrent.Future.
def _get_future():
try:
from concurrent.futures import Future
except ImportError:
try:
from tornado.concurrent import Future
except ImportError:
raise ImportError(
'Error Importing Future, Could not find concurrent.futures or tornado.concurrent',
)
return Future()To make it work with asyncio, I had to manually patch _get_future:
from asyncio import Future
from typing import Any
import doubles
def fix_doubles_future() -> None:
def _get_future() -> Future[Any]:
return Future()
doubles.allowance._get_future = _get_future
fix_doubles_future()There should be a way to configure this globally or on a per-call basis.
Btw, I'd be happy to implement the fix but it seems this repository is not maintained anymore: #145
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels