mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
refactor: replace os.socket with socket for DNS resolution consistency
This commit is contained in:
parent
80b13d1e8a
commit
978d8e0e8b
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user