Fix except statements for Py2.5 compat

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

View file

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

View file

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