1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Replace use of removeprefix with slicing

This commit is contained in:
Samuel Parkinson
2023-02-20 18:31:25 +00:00
parent 1bb672ed05
commit ab64a6b0e4

View File

@@ -101,7 +101,7 @@ class SpfDnsLookupProcessor(BaseProcessor):
if spf is None:
return lookups
terms = spf.removeprefix('v=spf1 ').split(' ')
terms = spf[len('v=spf1 ') :].split(' ')
for term in terms:
if lookups > 10:
@@ -120,7 +120,7 @@ class SpfDnsLookupProcessor(BaseProcessor):
# The include mechanism can result in further lookups after resolving the DNS record
if term.startswith('include:'):
domain = term.removeprefix('include:')
domain = term[len('include:') :]
answer = dns.resolver.resolve(domain, 'TXT')
answer_values = self._process_answer(answer)
lookups = self._check_dns_lookups(