Use except x as y instead of except x, y

According to https://docs.python.org/3/howto/pyporting.html the
syntax changed in Python 3.x. The new syntax is usable with
Python >= 2.6 and should be preferred to be compatible with Python3.

Enabled hacking check H231.

Change-Id: I7ce80163cc328c0368583d1dc76e9e0b0f7cd6dc
This commit is contained in:
Christian Berendt 2014-05-30 00:13:23 +02:00
parent b08b5928b6
commit 2f16664b83
2 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class TestLayoutValidator(testtools.TestCase):
if m.group(1) == 'good':
try:
validator.validate(data)
except voluptuous.Invalid, e:
except voluptuous.Invalid as e:
raise Exception(
'Unexpected YAML syntax error in %s:\n %s' %
(fn, str(e)))
@ -53,7 +53,7 @@ class TestLayoutValidator(testtools.TestCase):
validator.validate(data)
raise Exception("Expected a YAML syntax error in %s." %
fn)
except voluptuous.Invalid, e:
except voluptuous.Invalid as e:
error = str(e)
print ' ', error
if error in errors:

View File

@ -37,5 +37,6 @@ commands = zuul-server -c etc/zuul.conf-sample -t -l {posargs}
[flake8]
ignore = E125,H
select = H231
show-source = True
exclude = .venv,.tox,dist,doc,build,*.egg