[networking] Avoid exception when port is not defined on socket error
This commit is contained in:
parent
2b0593a51e
commit
969210a723
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user