diff --git a/graphitesend/graphitesend.py b/graphitesend/graphitesend.py index e0ea23d..a0ec882 100644 --- a/graphitesend/graphitesend.py +++ b/graphitesend/graphitesend.py @@ -8,6 +8,7 @@ import pickle import socket import struct +import sys import time import random @@ -286,6 +287,9 @@ def _send(self, message): """ Given a message send it to the graphite server. """ + # Python 3 support + if sys.version_info >= (3, 0) and type(message) == bytes: + message = str(message, 'utf-8') self.socket.sendall(message.encode("ascii"))