Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cancellation being swallowed in tasks #182

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/pylutron_caseta/smartbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,6 @@ async def _monitor(self):
try:
while True:
await self._monitor_once()
except asyncio.CancelledError:
pass
except Exception as ex:
_LOG.critical("monitor loop has exited", exc_info=1)
if not self._login_completed.done():
Expand Down Expand Up @@ -856,8 +854,6 @@ async def _login(self):

if not self._login_completed.done():
self._login_completed.set_result(None)
except asyncio.CancelledError:
pass
except Exception as ex:
if not self._login_completed.done():
self._login_completed.set_exception(ex)
Expand All @@ -872,8 +868,6 @@ async def _ping(self):
except asyncio.TimeoutError:
_LOG.warning("ping was not answered. closing connection.")
self._leap.close()
except asyncio.CancelledError:
pass
except Exception:
_LOG.warning("ping failed. closing connection.", exc_info=1)
self._leap.close()
Expand Down