Replace deprecated socket.error exception with OSError (#2830)

This warning was raised by the UP024 rule in Ruff.
This commit is contained in:
correctmost 2024-11-16 04:53:43 -05:00 committed by GitHub
parent 0f2e00952f
commit d644b5cae2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ def ping(hostname, timeout=5) -> int:
if icmp_type == 0 and response[-len(random_identifier):] == random_identifier:
latency = round((time.time() - started) * 1000)
break
except socket.error as error:
except OSError as error:
debug(f"Error: {error}")
break