Improve Python 3.x compatibility
Some mechanical translation of the deprecated except x,y construct. Should work with Python >= 2.6 just fine Change-Id: I394f9956b9e3e3d9f5f1e9ad50c35b13200af2a1
This commit is contained in:
+2
-2
@@ -61,7 +61,7 @@ class TestClient(testtools.TestCase):
|
||||
# rather than assertRaises() so that we can check the body of
|
||||
# the exception.
|
||||
self.fail('An exception should have bypassed this line.')
|
||||
except exc.CommunicationError, comm_err:
|
||||
except exc.CommunicationError as comm_err:
|
||||
fail_msg = ("Exception message '%s' should contain '%s'" %
|
||||
(comm_err.message, self.endpoint))
|
||||
self.assertTrue(self.endpoint in comm_err.message, fail_msg)
|
||||
@@ -100,7 +100,7 @@ class TestClient(testtools.TestCase):
|
||||
client.raw_request('GET', '/v1/images/detail?limit=20')
|
||||
|
||||
self.fail('An exception should have bypassed this line.')
|
||||
except exc.CommunicationError, comm_err:
|
||||
except exc.CommunicationError as comm_err:
|
||||
fail_msg = ("Exception message '%s' should contain '%s'" %
|
||||
(comm_err.message, endpoint))
|
||||
self.assertTrue(endpoint in comm_err.message, fail_msg)
|
||||
|
||||
Reference in New Issue
Block a user