summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redis/_compat.py6
-rw-r--r--tox.ini2
2 files changed, 6 insertions, 2 deletions
diff --git a/redis/_compat.py b/redis/_compat.py
index e4cc34c..146e37d 100644
--- a/redis/_compat.py
+++ b/redis/_compat.py
@@ -166,6 +166,11 @@ else:
def nativestr(x):
return x if isinstance(x, str) else x.decode('utf-8', 'replace')
+ def safe_unicode(value):
+ if isinstance(value, bytes):
+ value = value.decode('utf-8', 'replace')
+ return str(value)
+
next = next
unichr = chr
imap = map
@@ -173,7 +178,6 @@ else:
xrange = range
basestring = str
unicode = str
- safe_unicode = str
long = int
BlockingIOError = BlockingIOError
diff --git a/tox.ini b/tox.ini
index 6ead282..35a4cbb 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,7 +9,7 @@ deps =
pytest >= 2.7.0
extras =
hiredis: hiredis
-commands = {envpython} -m coverage run -m pytest -W always {posargs}
+commands = {envpython} -b -m coverage run -m pytest -W always {posargs}
[testenv:pycodestyle]
basepython = python3.6