From d34f42791330bf9d78901be7a4783c0ebd04d279 Mon Sep 17 00:00:00 2001 From: Lars Orum Rasmussen Date: Thu, 18 Jul 2019 14:07:10 +0200 Subject: [PATCH] Raise an exception if no sockets to poll --- posttroll/subscriber.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/posttroll/subscriber.py b/posttroll/subscriber.py index de78e27..e1fb6fe 100644 --- a/posttroll/subscriber.py +++ b/posttroll/subscriber.py @@ -191,6 +191,8 @@ def recv(self, timeout=None): for sub in list(self.subscribers) + self._hooks: self.poller.register(sub, POLLIN) + if not self.poller.sockets: + raise IOError("No sockect to poll") self._loop = True try: while self._loop: