Skip to content

Commit

Permalink
Fixed failing tests after upgrade of socket exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Jan 30, 2023
1 parent 29514c2 commit f921bce
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions daliuge-common/dlg/common/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ def check_port(host, port, timeout=0, checking_open=True, return_socket=False):
if not return_socket:
s.close()
except (OSError, socket.error):
s.close()
logger.error("Unable to connect to %s:%s", host, port)
return not checking_open
if socket.error:
s.close()
raise
elif OSError:
logger.error("Unable to connect to %s:%s", host, port)
return not checking_open

# Success if we were checking for an open port!
if checking_open:
Expand Down

0 comments on commit f921bce

Please sign in to comment.