Commit 50ca1fc4 authored by Denis Bilenko's avatar Denis Bilenko

examples/dns_mass_resolve.py: 2.4-compatibility

parent 4d4d3931
......@@ -20,10 +20,11 @@ finished = 0
def job(url):
global succeed, finished
try:
ip = socket.gethostbyname(url)
print '%s = %s' % (url, ip)
except socket.gaierror, ex:
print '%s failed with %s' % (url, ex)
try:
ip = socket.gethostbyname(url)
print '%s = %s' % (url, ip)
except socket.gaierror, ex:
print '%s failed with %s' % (url, ex)
finally:
finished += 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment