Fix except statements for Py2.5 compat

This commit is contained in:
Calum Lind 2017-04-01 11:38:28 +01:00
parent 08c03d7678
commit 1f315a9ef0
2 changed files with 3 additions and 3 deletions

View file

@ -206,7 +206,7 @@ class ConnectionManager(component.Component):
try:
gethostbyname(host)
except gaierror as ex:
except gaierror, ex:
raise Exception("Host '%s': %s" % (host, ex.args[1]))
# Host isn't in the list, so lets add it
@ -311,7 +311,7 @@ class ConnectionManager(component.Component):
try:
ip = gethostbyname(host)
except gaierror as ex:
except gaierror, ex:
log.error("Error resolving host %s to ip: %s", host, ex.args[1])
continue

View file

@ -919,7 +919,7 @@ class WebApi(JSONComponent):
try:
gethostbyname(host)
except gaierror as ex:
except gaierror, ex:
return (False, "Hostname error: %s" % ex.args[1])
try: