diff options
author | Dirk Mueller <dirk@dmllr.de> | 2013-08-28 21:16:08 +0200 |
---|---|---|
committer | Dirk Mueller <dirk@dmllr.de> | 2013-08-28 21:16:08 +0200 |
commit | 7c5e91e77faaf6ddb344ebe12b4c46f2259d104c (patch) | |
tree | 6a28ed470ca627876fc05d3734120ce1c6cd5965 | |
parent | e72cde05822e5c4f38723a4eab3b8dc5a65494c7 (diff) | |
download | swift-bench-7c5e91e77faaf6ddb344ebe12b4c46f2259d104c.tar.gz |
Use Python 3.x compatible except construct
except x,y: was deprected and is removed in Python 3.x.
Use "except x as y:" instead which works in any Python
version >= 2.6.
Change-Id: I7008c74b807340f3457d3a0c8bd0b83f23169d14
-rw-r--r-- | swift/common/bench.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/swift/common/bench.py b/swift/common/bench.py index be4e9a9..97d8048 100644 --- a/swift/common/bench.py +++ b/swift/common/bench.py @@ -52,7 +52,7 @@ def delete_containers(logger, conf): def _deleter(url, token, container): try: client.delete_container(url, token, container) - except client.ClientException, e: + except client.ClientException as e: if e.http_status != HTTP_CONFLICT: logger.warn("Unable to delete container '%s'. " "Got http status '%d'." @@ -413,7 +413,7 @@ class BenchDELETE(Bench): direct_client.direct_delete_object(node, partition, self.account, container_name, name) - except client.ClientException, e: + except client.ClientException as e: self.logger.debug(str(e)) self.failures += 1 self.complete += 1 @@ -442,7 +442,7 @@ class BenchGET(Bench): direct_client.direct_get_object(node, partition, self.account, container_name, name) - except client.ClientException, e: + except client.ClientException as e: self.logger.debug(str(e)) self.failures += 1 self.complete += 1 @@ -486,7 +486,7 @@ class BenchPUT(Bench): container_name, name, source, content_length=len(source)) - except client.ClientException, e: + except client.ClientException as e: self.logger.debug(str(e)) self.failures += 1 else: |