Fix deprecation warning for resolver.query()

/home/travis/build/linkchecker/linkchecker/linkcheck/checker/mailtourl.py:321: DeprecationWarning: please use dns.resolver.resolve() instead
    answers = resolver.query(domain, 'MX')
This commit is contained in:
Chris Mayo 2020-09-14 19:55:05 +01:00
parent 70d749a967
commit 26c15c5e67
4 changed files with 4 additions and 4 deletions

View file

@ -319,7 +319,7 @@ class MailtoUrl(urlbase.UrlBase):
username, domain = mail.rsplit('@', 1)
log.debug(LOG_CHECK, "looking up MX mailhost %r", domain)
try:
answers = resolver.query(domain, 'MX')
answers = resolver.resolve(domain, 'MX', search=True)
except DNSException:
answers = []
if len(answers) == 0:

View file

@ -2,6 +2,6 @@
beautifulsoup4
requests >= 2.4
pyxdg
dnspython
dnspython >= 2.0
# optional:
argcomplete

View file

@ -378,7 +378,7 @@ setup(
python_requires=">= 3.6",
install_requires=[
"requests >= 2.4",
"dnspython",
"dnspython >= 2.0",
"beautifulsoup4",
"pyxdg",
],

View file

@ -30,7 +30,7 @@ deps =
beautifulsoup4 < 4.8.1
requests >= 2.4
pyxdg
dnspython
dnspython >= 2.0
{[base]deps}
[testenv:flake8]