Skip to content

Commit

Permalink
Fixed error in Client.stop() when the session is already None
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Feb 28, 2018
1 parent 0592661 commit c36b4e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions asphalt/wamp/client.py
Expand Up @@ -191,8 +191,9 @@ async def stop(self):
len(self._request_tasks))
await wait(self._request_tasks)

with suppress(SessionNotReady):
await self._session.leave()
if self._session: # The session might be gone at this point
with suppress(SessionNotReady):
await self._session.leave()
except TransportLost:
pass
except asyncio.TimeoutError:
Expand Down

0 comments on commit c36b4e1

Please sign in to comment.