Update tests/CrawlerRunner/ip_address.py

Co-authored-by: Eugenio Lacuesta <1731933+elacuesta@users.noreply.github.com>
This commit is contained in:
Adrián Chaves 2020-07-06 10:47:11 +02:00 committed by GitHub
parent eb93774256
commit ec06cf79a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -15,8 +15,7 @@ from tests.mockserver import MockServer, MockDNSServer
# https://stackoverflow.com/a/32784190
def createResolver(servers=None, resolvconf=None, hosts=None):
if hosts is None:
hosts = (b'/etc/hosts' if platform.getType() == 'posix'
else r'c:\windows\hosts')
hosts = b'/etc/hosts' if platform.getType() == 'posix' else r'c:\windows\hosts'
theResolver = Resolver(resolvconf, servers)
hostResolver = hostsModule.Resolver(hosts)
L = [hostResolver, cache.CacheResolver(), theResolver]