whitespace normalization

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3106 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-04-03 19:15:07 +00:00
parent b503ea15f4
commit 78dfb4c293
3 changed files with 19 additions and 21 deletions

View file

@ -118,10 +118,10 @@ def synchronize (lock, func):
def synchronized (lock):
"""
A decorator calling a function with aqcuired lock.
"""
return lambda func: synchronize(lock, func)
"""
A decorator calling a function with aqcuired lock.
"""
return lambda func: synchronize(lock, func)
def notimplemented (func):
@ -193,4 +193,3 @@ class curried (object):
return curried(self.func, *args)
else:
return self.func(*args)

View file

@ -585,9 +585,9 @@ class Resolver(object):
request.use_tsig(self.keyring, self.keyname)
request.use_edns(self.edns, self.ednsflags, self.payload)
response = None
# make a copy of the servers list so we can alter it later.
nameservers = self.nameservers[:]
backoff = 0.10
while response is None:
@ -605,24 +605,24 @@ class Resolver(object):
response = linkcheck.dns.query.udp(request, nameserver,
timeout, self.port)
except (socket.error, linkcheck.dns.exception.Timeout):
# Communication failure or timeout. Go to the
# next server
response = None
continue
except linkcheck.dns.query.UnexpectedSource:
# Who knows? Keep going.
response = None
continue
except linkcheck.dns.exception.FormError:
# We don't understand what this server is
# saying. Take it out of the mix and
# continue.
nameservers.remove(nameserver)
response = None
continue
@ -630,22 +630,22 @@ class Resolver(object):
if rcode == linkcheck.dns.rcode.NOERROR or \
rcode == linkcheck.dns.rcode.NXDOMAIN:
break
# We got a response, but we're not happy with the
# rcode in it. Remove the server from the mix if
# the rcode isn't SERVFAIL.
if rcode != linkcheck.dns.rcode.SERVFAIL:
nameservers.remove(nameserver)
response = None
# All nameservers failed!
if len(nameservers) > 0:
# But we still have servers to try. Sleep a bit
# so we don't pound them!
timeout = self._compute_timeout(start)
sleep_time = min(timeout, backoff)
backoff *= 2

View file

@ -61,7 +61,7 @@ def has_module (name):
"""
try:
exec "import %s" % name
return True
return True
except ImportError:
return False
@ -170,4 +170,3 @@ def has_changed (filename):
_mtime_cache[key] = mtime
return True
return mtime > _mtime_cache[key]