summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2015-08-03 10:51:37 +0200
committerJakub Stasiak <jakub@stasiak.at>2015-08-03 10:51:37 +0200
commitb0b1debaa9f4ed15ad3e14e8b8ce037ce32b1ee0 (patch)
tree0c8aba17149227cdb2d01e9c4f53f76cbf4f843a
parent852c849b74cae87c80df89aafe0a9fb11bcccae5 (diff)
downloadpystatsd-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.py2
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