Skip to content

Commit

Permalink
Hide if no hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Jun 23, 2021
1 parent 0b61044 commit be98bba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spinnman/utilities/locate_connected_machine_ip_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def _ctrlc_handler(sig, frame): # @UnusedVariable

def _print_connected(ip_address, timestamp):
try:
hostname = socket.gethostbyaddr(ip_address)[0]
hostname = f" ({socket.gethostbyaddr(ip_address)[0]})"
except Exception:
hostname = "Unknown host"
print(ip_address, "({})".format(hostname), "at", timestamp)
hostname = ""
print(f"{ip_address}{hostname} at {timestamp}")
return False

print("The following addresses might be SpiNNaker boards "
Expand Down

0 comments on commit be98bba

Please sign in to comment.