diff --git a/launch/utils.py b/launch/utils.py index 3ab9088f49..2811a17ebc 100644 --- a/launch/utils.py +++ b/launch/utils.py @@ -188,7 +188,7 @@ def ssh_connect(ip, username, connect_kwargs={}, timeout=60): try: client = SSHClient(ip, username, **connect_kwargs) break - except socket.error, e: + except socket.error as e: print "While testing ssh access:", e time.sleep(5) diff --git a/modules/log_processor/files/log-gearman-worker.py b/modules/log_processor/files/log-gearman-worker.py index 23ca4dc21b..0a418d701c 100644 --- a/modules/log_processor/files/log-gearman-worker.py +++ b/modules/log_processor/files/log-gearman-worker.py @@ -180,7 +180,7 @@ class LogRetriever(threading.Thread): raw_buf = b'' try: gzipped, raw_buf = self._get_log_data(source_url, retry) - except urllib2.HTTPError, e: + except urllib2.HTTPError as e: if e.code == 404: logging.info("Unable to retrieve %s: HTTP error 404" % source_url) diff --git a/tox.ini b/tox.ini index da3a6128f6..787d7606b4 100644 --- a/tox.ini +++ b/tox.ini @@ -31,6 +31,7 @@ commands = python modules/accessbot/files/checkaccess.py -l modules/openstack_pr show-source = True exclude = .tox ignore = E125,H +select = H231 [testenv:jjb] basepython = python2.7