aboutsummaryrefslogtreecommitdiff
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
commitca7634be5d6b68028ebd254c76c484dd6aa3df6e (patch)
tree19776d211e2a5b55a2dd453ec2053821ecfe0c29
parentb94c598e54ddcc712556ec115355816b5564b522 (diff)
downloadcrupest-ca7634be5d6b68028ebd254c76c484dd6aa3df6e.tar.gz
crupest-ca7634be5d6b68028ebd254c76c484dd6aa3df6e.tar.bz2
crupest-ca7634be5d6b68028ebd254c76c484dd6aa3df6e.zip
Fix aio dns.
-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