mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-11 01:02:10 +03:00
Merge 757fe8cab8 into 8c99ac78b7
This commit is contained in:
commit
cd739768b2
1 changed files with 2 additions and 1 deletions
|
|
@ -201,7 +201,8 @@ def _resolvers_windows() -> dict[str, list[str]]:
|
||||||
def _resolvers_unix() -> dict[str, list[str]]:
|
def _resolvers_unix() -> dict[str, list[str]]:
|
||||||
adapters: dict[str, list[str]] = {}
|
adapters: dict[str, list[str]] = {}
|
||||||
try:
|
try:
|
||||||
text = open("/etc/resolv.conf", encoding="utf-8", errors="replace").read()
|
with open("/etc/resolv.conf", encoding="utf-8", errors="replace") as f:
|
||||||
|
text = f.read()
|
||||||
except OSError:
|
except OSError:
|
||||||
text = ""
|
text = ""
|
||||||
servers = [line.split()[1] for line in text.splitlines() if line.startswith("nameserver") and len(line.split()) > 1]
|
servers = [line.split()[1] for line in text.splitlines() if line.startswith("nameserver") and len(line.split()) > 1]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue