aboutsummaryrefslogtreecommitdiff
path: root/tool/modules/dns.py
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-11-28 17:39:45 +0800
committercrupest <crupest@outlook.com>2022-11-28 17:39:45 +0800
commite701d832e03dd12574621e49ba7478af90797e61 (patch)
tree19776d211e2a5b55a2dd453ec2053821ecfe0c29 /tool/modules/dns.py
parentca998f2be058536349cc4ccb3060d9a17ea42b6c (diff)
downloadcrupest-e701d832e03dd12574621e49ba7478af90797e61.tar.gz
crupest-e701d832e03dd12574621e49ba7478af90797e61.tar.bz2
crupest-e701d832e03dd12574621e49ba7478af90797e61.zip
Fix aio dns.
Diffstat (limited to 'tool/modules/dns.py')
-rw-r--r--tool/modules/dns.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/modules/dns.py b/tool/modules/dns.py
index 0334353..761a1f5 100644
--- a/tool/modules/dns.py
+++ b/tool/modules/dns.py
@@ -30,10 +30,10 @@ def get_dkim_from_mailserver(domain: str) -> str | None:
if not exists(dkim_path):
return None
- buffer = StringIO()
- subprocess.run(["sudo", "cat", dkim_path], stdout=buffer, check=True)
+ p = subprocess.run(["sudo", "cat", dkim_path],
+ capture_output=True, check=True)
value = ""
- for match in re.finditer("\"(.*)\"", str(buffer)):
+ for match in re.finditer("\"(.*)\"", p.stdout.decode('utf-8')):
value += match.groups[1]
return value