[networking] Avoid exception when port is not defined on socket error

This commit is contained in:
nemunaire 2015-09-01 20:29:11 +02:00
parent 2b0593a51e
commit 969210a723

View File

@ -37,7 +37,7 @@ def headers(url):
raise IRCException("request timeout")
except socket.gaierror:
print ("<tools.web> Unable to receive page %s from %s on %d."
% (o.path, o.hostname, o.port))
% (o.path, o.hostname, o.port if o.port is not None else 0))
raise IRCException("an unexpected error occurs")
try: