Permalink
Browse files

fix accessor cache on python 3.x

  • Loading branch information...
Roguelazer authored and adriengentil committed Jan 3, 2019
1 parent 53e2edf commit 3293ee4ecffd590db8f8c8d92e8633685bb407df
Showing with 4 additions and 0 deletions.
  1. +4 −0 biggraphite/accessor_cache.py
@@ -17,6 +17,8 @@
from __future__ import absolute_import
from __future__ import print_function

import sys

import abc
import hashlib

@@ -93,6 +95,8 @@ def __init__(self, django_cache):

def _make_key(self, key):
"""Construct a clean key from a key."""
if sys.version_info > (3, 0):
key = key.encode('utf-8')
return hashlib.md5(key).hexdigest()

def set(self, key, value, timeout=None, version=None):

0 comments on commit 3293ee4

Please sign in to comment.