refactor: replace os.socket with socket for DNS resolution consistency

This commit is contained in:
Alessandro Perazzetta 2025-05-26 17:41:50 +02:00
parent 80b13d1e8a
commit 978d8e0e8b

View File

@ -12,7 +12,7 @@ import inspect
import subprocess
import contextlib
import importlib.metadata
import socket
# External library
from unidecode import unidecode
@ -334,9 +334,9 @@ class InternManager():
try:
for domain in test_domains:
# socket.gethostbyname() works consistently across all platforms
os.socket.gethostbyname(domain)
socket.gethostbyname(domain)
return True
except (os.socket.gaierror, os.socket.error):
except (socket.gaierror, socket.error):
return False
class OsSummary: