Skip to content

Commit

Permalink
solve error
Browse files Browse the repository at this point in the history
  • Loading branch information
7174Andy committed Dec 19, 2024
1 parent 73a015b commit c911010
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sleap/gui/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Generic module containing utilities used for the GUI."""

import zmq
from time import sleep
import time
from typing import Optional


Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions sleap/gui/widgets/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c911010

Please sign in to comment.