diff --git a/sleap/gui/utils.py b/sleap/gui/utils.py index 0aad690a5..b974e26e8 100644 --- a/sleap/gui/utils.py +++ b/sleap/gui/utils.py @@ -1,7 +1,7 @@ """Generic module containing utilities used for the GUI.""" import zmq -from time import sleep +import time from typing import Optional @@ -13,7 +13,7 @@ def is_port_free(port: int, zmq_context: Optional[zmq.Context] = None) -> bool: try: socket.bind(address) socket.unbind(address) - sleep(0.1) + time.sleep(0.1) return True except zmq.error.ZMQError: return False diff --git a/sleap/gui/widgets/monitor.py b/sleap/gui/widgets/monitor.py index 14dd0f966..9a17eecff 100644 --- a/sleap/gui/widgets/monitor.py +++ b/sleap/gui/widgets/monitor.py @@ -1090,14 +1090,12 @@ def _unbind(self): if self.sub is not None: self.sub.unbind(self.sub.LAST_ENDPOINT) self.sub.close() - time.sleep(0.1) self.sub = None if self.zmq_ctrl is not None: url = self.zmq_ctrl.LAST_ENDPOINT self.zmq_ctrl.unbind(url) self.zmq_ctrl.close() - time.sleep(0.1) self.zmq_ctrl = None # If we started out own zmq context, terminate it.