diff options
author | Jakub Stasiak <jakub@stasiak.at> | 2015-08-03 10:51:37 +0200 |
---|---|---|
committer | Jakub Stasiak <jakub@stasiak.at> | 2015-08-03 10:51:37 +0200 |
commit | b0b1debaa9f4ed15ad3e14e8b8ce037ce32b1ee0 (patch) | |
tree | 0c8aba17149227cdb2d01e9c4f53f76cbf4f843a | |
parent | 852c849b74cae87c80df89aafe0a9fb11bcccae5 (diff) | |
download | pystatsd-b0b1debaa9f4ed15ad3e14e8b8ce037ce32b1ee0.tar.gz |
Ignore RuntimeErrors together with socket errors
When Python's standard library is patched with Eventlet the exception
raised when two threads access the same socket simultaneously is
RuntimeError and I think it makes sense to include it here.
The downside is it may start ignoring too wide variety of exceptions but
on the other hand I can't think of any other RuntimeErrors that can be
raised here.
-rw-r--r-- | statsd/client.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/statsd/client.py b/statsd/client.py index 73e7712..357597a 100644 --- a/statsd/client.py +++ b/statsd/client.py @@ -146,7 +146,7 @@ class StatsClient(StatsClientBase): """Send data to statsd.""" try: self._sock.sendto(data.encode('ascii'), self._addr) - except socket.error: + except (socket.error, RuntimeError): # No time for love, Dr. Jones! pass |