Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ def __init__(
async def get_or_create(self, key: _Key) -> _Client:
if key not in self._live_clients:
self._live_clients[key] = asyncio.ensure_future(self._factory(key))
return await self._live_clients[key]
future = self._live_clients[key]
try:
return await future
except BaseException as e:
if key in self._live_clients and self._live_clients[key] is future:
del self._live_clients[key]
raise e

async def try_erase(self, key: _Key, client: _Client):
if key not in self._live_clients:
Expand Down