Skip to content

Commit

Permalink
Fixes issue robertmrk#7 from original library
Browse files Browse the repository at this point in the history
  • Loading branch information
brberry committed Apr 15, 2024
1 parent 95758c5 commit e48de78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion aiocometd_ng/transports/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Base transtport abstract class definition"""
import asyncio
from asyncio.exceptions import CancelledError
import logging
from abc import abstractmethod
from contextlib import suppress
Expand Down Expand Up @@ -510,7 +511,7 @@ def _connect_done(self, future: "asyncio.Future[JsonObject]") -> None:
"reconnect" in result["advice"]):
reconnect_advice = result["advice"]["reconnect"]
self._state = TransportState.CONNECTED
except Exception as error: # pylint: disable=broad-except
except (Exception, CancelledError): # pylint: disable=broad-except
result = error
reconnect_timeout = self._reconnect_timeout
if self.state != TransportState.DISCONNECTING:
Expand Down
3 changes: 2 additions & 1 deletion aiocometd_ng/transports/websocket.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Websocket transport class definition"""
import asyncio
from asyncio.exceptions import CancelledError
import logging
from contextlib import suppress
from typing import Callable, Optional, AsyncContextManager, Any, Awaitable, \
Expand Down Expand Up @@ -257,7 +258,7 @@ def _receive_done(self, future: "asyncio.Task[None]") -> None:
# extract the result of the future
try:
result = future.result()
except Exception as error: # pylint: disable=broad-except
except (Exception, CancelledError) as error: # pylint: disable=broad-except
result = error
# clear the receive task
self._receive_task = None
Expand Down

0 comments on commit e48de78

Please sign in to comment.