Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
language: python

python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "pypy"
- "pypy3"

# command to install dependencies
install:
Expand Down
1 change: 0 additions & 1 deletion statsd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,3 @@ def __repr__(self):

def _send(self, data):
return self.connection.send(data)

6 changes: 6 additions & 0 deletions statsd/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ def send(self, data, sample_rate=None):
self.logger.exception('unexpected error %r while sending data', e)
return False

def __del__(self):
'''
We close UDP socket connection explicitly for pypy.
'''
self.udp_sock.close()

def __repr__(self):
return '<%s[%s:%d] P(%.1f)>' % (
self.__class__.__name__,
Expand Down
1 change: 0 additions & 1 deletion statsd/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def _decorator(*args, **kwargs):
finally:
# Stop the timer, send the message and cleanup
timer.stop('')
del timer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implicit del should be fine

return _decorator

Expand Down