summaryrefslogtreecommitdiff
path: root/tests/test_swiftclient.py
diff options
context:
space:
mode:
authorDirk Mueller <dirk@dmllr.de>2013-04-25 23:19:52 +0200
committerDirk Mueller <dirk@dmllr.de>2013-04-29 11:08:47 +0200
commit000e33d0218b1e71d8798f3bd208f92cb89eaa7f (patch)
treef86191f15faf8878888d3a05006fb0a13168d89f /tests/test_swiftclient.py
parent2d97609a52bef2f437c15ff72dced29663c570ff (diff)
downloadpython-swiftclient-000e33d0218b1e71d8798f3bd208f92cb89eaa7f.tar.gz
Improve Python 3.x compatibility
Some mechancical replacement of the deprecated except x,y: construct with except x as y, which works with any Python version >= 2.6 Change-Id: Ic245049dc7b408a5c89b9e27dfd2bd7c08acc5b5
Diffstat (limited to 'tests/test_swiftclient.py')
-rw-r--r--tests/test_swiftclient.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index 5fd1e28..54ad8d4 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -625,7 +625,7 @@ class TestConnection(MockHttpTest):
except AssertionError:
msg = '%s did not read resp on server error' % method.__name__
self.fail(msg)
- except Exception, e:
+ except Exception as e:
raise e.__class__("%s - %s" % (method.__name__, e))
def test_reauth(self):
@@ -727,7 +727,7 @@ class TestConnection(MockHttpTest):
exc = None
try:
conn.put_object('c', 'o', contents)
- except socket.error, err:
+ except socket.error as err:
exc = err
self.assertEquals(contents.seeks, [0])
self.assertEquals(str(exc), 'oops')
@@ -736,7 +736,7 @@ class TestConnection(MockHttpTest):
exc = None
try:
conn.put_object('c', 'o', contents)
- except socket.error, err:
+ except socket.error as err:
exc = err
self.assertEquals(contents.seeks, [123])
self.assertEquals(str(exc), 'oops')
@@ -746,7 +746,7 @@ class TestConnection(MockHttpTest):
exc = None
try:
conn.put_object('c', 'o', contents)
- except c.ClientException, err:
+ except c.ClientException as err:
exc = err
self.assertEquals(contents.seeks, [])
self.assertEquals(str(exc), "put_object('c', 'o', ...) failure "