Fix a try/catch

This commit is contained in:
Guillaume Ayoub 2011-10-27 13:25:06 +02:00
parent 1af4601276
commit 14a6cd10b4

View File

@ -44,9 +44,9 @@ def has_right(owner, user, password):
sock.send(line)
data = sock.recv(1024)
sock.close()
except socket.error, (_, message):
except socket.error as exception:
log.LOGGER.debug(
"Unable to communicate with Courier socket: %s" % message)
"Unable to communicate with Courier socket: %s" % exception)
return False
log.LOGGER.debug("Got Courier socket response: %r" % data)