Use Python 3.x compatible except: construct
Per (proposed) hacking H203 check, use the non-deprecated except x as y: construct, which works with any Python version >= 2.6 Change-Id: Ib7cab00cb8f219154663a4d51a855a1a2718e8cb
This commit is contained in:
parent
f67c5e0cf9
commit
e476179c65
@ -119,7 +119,7 @@ class ShellTest(utils.TestCase):
|
||||
self.make_env(exclude='OS_USERNAME')
|
||||
try:
|
||||
self.shell('list')
|
||||
except exceptions.CommandError, message:
|
||||
except exceptions.CommandError as message:
|
||||
self.assertEqual(required, message.args)
|
||||
else:
|
||||
self.fail('CommandError not raised')
|
||||
@ -130,7 +130,7 @@ class ShellTest(utils.TestCase):
|
||||
self.make_env(exclude='OS_TENANT_NAME')
|
||||
try:
|
||||
self.shell('list')
|
||||
except exceptions.CommandError, message:
|
||||
except exceptions.CommandError as message:
|
||||
self.assertEqual(required, message.args)
|
||||
else:
|
||||
self.fail('CommandError not raised')
|
||||
@ -143,7 +143,7 @@ class ShellTest(utils.TestCase):
|
||||
self.make_env(exclude='OS_AUTH_URL')
|
||||
try:
|
||||
self.shell('list')
|
||||
except exceptions.CommandError, message:
|
||||
except exceptions.CommandError as message:
|
||||
self.assertEqual(required, message.args)
|
||||
else:
|
||||
self.fail('CommandError not raised')
|
||||
@ -176,7 +176,7 @@ class ShellTest(utils.TestCase):
|
||||
self.make_env(exclude='OS_PASSWORD')
|
||||
try:
|
||||
self.shell('list')
|
||||
except exceptions.CommandError, message:
|
||||
except exceptions.CommandError as message:
|
||||
self.assertEqual(required, message.args)
|
||||
else:
|
||||
self.fail('CommandError not raised')
|
||||
|
Loading…
x
Reference in New Issue
Block a user