diff options
| author | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-10-25 19:09:16 +0900 |
|---|---|---|
| committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-10-25 19:09:38 +0900 |
| commit | 89b5d495c329143f433d1fbe89c962c5ff1f81b4 (patch) | |
| tree | 71ea634529f2457a6d20e079e37905e125c9bfad /pygerrit/stream.py | |
| parent | 1ce36c40f662b443e199e58a14863d136e435310 (diff) | |
| download | pygerrit-89b5d495c329143f433d1fbe89c962c5ff1f81b4.tar.gz | |
Python 2.6 style exception handling
Handle exceptions with the syntax:
except Exception as e
rather than:
except Exception, e
Change-Id: I883fdc1db541b9d2699712bfd2bd328261635005
Diffstat (limited to 'pygerrit/stream.py')
| -rw-r--r-- | pygerrit/stream.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pygerrit/stream.py b/pygerrit/stream.py index 41572ce..3ca324b 100644 --- a/pygerrit/stream.py +++ b/pygerrit/stream.py @@ -71,7 +71,7 @@ class GerritStream(Thread): """ Listen to the stream and send events to the client. """ try: result = self._ssh_client.run_gerrit_command("stream-events") - except GerritError, e: + except GerritError as e: self._error_event(e) poller = poll() @@ -85,7 +85,7 @@ class GerritStream(Thread): line = stdout.readline() json_data = json.loads(line) self._gerrit.put_event(json_data) - except (ValueError, IOError), err: + except (ValueError, IOError) as err: self._error_event(err) - except GerritError, err: + except GerritError as err: logging.error("Failed to put event: %s", err) |
