Skip to content

Commit

Permalink
black, isort
Browse files Browse the repository at this point in the history
  • Loading branch information
borzunov committed Aug 24, 2023
1 parent 6df4e32 commit 4cf9cdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions hivemind/utils/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ def safe_recv(pipe: mp.connection.Connection) -> Any:
try:
return pipe.recv()
except Exception as e:
if (
(isinstance(e, BlockingIOError) and str(e) == "[Errno 35] Resource temporarily unavailable") or
(isinstance(e, EOFError) and str(e) == "Ran out of input")
if (isinstance(e, BlockingIOError) and str(e) == "[Errno 35] Resource temporarily unavailable") or (
isinstance(e, EOFError) and str(e) == "Ran out of input"
):
logger.warning(repr(e))
time.sleep(0)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_util_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from hivemind.compression import deserialize_torch_tensor, serialize_torch_tensor
from hivemind.proto.runtime_pb2 import CompressionType
from hivemind.utils import BatchTensorDescriptor, DHTExpiration, HeapEntry, MSGPackSerializer, ValueWithExpiration
from hivemind.utils.compat import safe_recv
from hivemind.utils.asyncio import (
achain,
aenumerate,
Expand All @@ -27,6 +26,7 @@
cancel_and_wait,
enter_asynchronously,
)
from hivemind.utils.compat import safe_recv
from hivemind.utils.mpfuture import InvalidStateError
from hivemind.utils.performance_ema import PerformanceEMA

Expand Down

0 comments on commit 4cf9cdf

Please sign in to comment.