mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-06 19:45:24 +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 subprocess
|
||||||
import contextlib
|
import contextlib
|
||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
|
import socket
|
||||||
|
|
||||||
# External library
|
# External library
|
||||||
from unidecode import unidecode
|
from unidecode import unidecode
|
||||||
@ -334,9 +334,9 @@ class InternManager():
|
|||||||
try:
|
try:
|
||||||
for domain in test_domains:
|
for domain in test_domains:
|
||||||
# socket.gethostbyname() works consistently across all platforms
|
# socket.gethostbyname() works consistently across all platforms
|
||||||
os.socket.gethostbyname(domain)
|
socket.gethostbyname(domain)
|
||||||
return True
|
return True
|
||||||
except (os.socket.gaierror, os.socket.error):
|
except (socket.gaierror, socket.error):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
class OsSummary:
|
class OsSummary:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user