diff --git a/requirements.txt b/requirements.txt index 3c377eed23986cd65579fb880bf3d885d3c823a1..f5438ce23f1221bdfbc3dbb976e5c2e668f6c924 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,5 @@ pytest pytest-asyncio<0.6 pyyaml aiohttp -async_timeout \ No newline at end of file +async_timeout +PyQt5>=5.5 \ No newline at end of file diff --git a/src/sakia/data/connectors/node.py b/src/sakia/data/connectors/node.py index d4a716add6980103c09d7da67dd63174171cd5f1..39da3cb54c32ee92abec4406b99f383e7906aac7 100644 --- a/src/sakia/data/connectors/node.py +++ b/src/sakia/data/connectors/node.py @@ -118,6 +118,11 @@ class NodeConnector(QObject): except jsonschema.ValidationError as e: self._logger.debug(str(e)) self.change_state_and_emit(Node.CORRUPTED) + except RuntimeError: + if self.session.closed: + pass + else: + raise async def init_session(self): if not self.session: @@ -137,6 +142,7 @@ class NodeConnector(QObject): closed = True await asyncio.sleep(0) await self.session.close() + await asyncio.sleep(0) def refresh(self, manual=False): """ @@ -184,6 +190,11 @@ class NodeConnector(QObject): self._logger.debug(str(e)) self._logger.debug("Validation error") self.change_state_and_emit(Node.CORRUPTED) + except RuntimeError: + if self.session.closed: + pass + else: + raise finally: self._connected['block'] = False self._ws_tasks['block'] = None @@ -308,6 +319,11 @@ class NodeConnector(QObject): except jsonschema.ValidationError as e: self._logger.debug(str(e)) self.change_state_and_emit(Node.CORRUPTED) + except RuntimeError: + if self.session.closed: + pass + else: + raise finally: self._connected['peer'] = False self._ws_tasks['peer'] = None diff --git a/src/sakia/main.py b/src/sakia/main.py index bc7020d16cc6a334cb1fb852f62f067c7c4a3f0f..924f16ad78efbccc6bad3ca02c93b71a66aab41b 100755 --- a/src/sakia/main.py +++ b/src/sakia/main.py @@ -88,6 +88,7 @@ def main(): sakia.setStyle('Fusion') loop = QSelectorEventLoop(sakia) loop.set_exception_handler(async_exception_handler) + #loop.set_debug(True) asyncio.set_event_loop(loop) with loop: