diff options
author | Alex Grönholm <alex.gronholm+git@nextday.fi> | 2012-08-07 01:19:01 +0300 |
---|---|---|
committer | Alex Grönholm <alex.gronholm+git@nextday.fi> | 2012-08-07 01:19:01 +0300 |
commit | 4f2911456df2e84aee9fb71984a990b9f8f472f5 (patch) | |
tree | 5515d05ca0c5ef9fde36e5b69c20e0ff56f28bf5 /redis/_compat.py | |
parent | 0aaa404f3525641fe5bb3b50ca303d05a326cdce (diff) | |
download | redis-py-4f2911456df2e84aee9fb71984a990b9f8f472f5.tar.gz |
Fixed compatibility issue with Python 2.5 and 2.6 introduced in the
previous commit
Diffstat (limited to 'redis/_compat.py')
-rw-r--r-- | redis/_compat.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/_compat.py b/redis/_compat.py index 2dbf62e..ebc5999 100644 --- a/redis/_compat.py +++ b/redis/_compat.py @@ -14,7 +14,7 @@ if sys.version_info[0] < 3: iteritems = lambda x: x.iteritems() dictkeys = lambda x: x.keys() dictvalues = lambda x: x.values() - nativestr = lambda x: x if isinstance(x, str) else x.encode(errors='replace') + nativestr = lambda x: x if isinstance(x, str) else x.encode('utf-8', 'replace') u = lambda x: x.decode() b = lambda x: x next = lambda x: x.next() @@ -34,7 +34,7 @@ else: dictkeys = lambda x: list(x.keys()) dictvalues = lambda x: list(x.values()) byte_to_chr = lambda x: chr(x) - nativestr = lambda x: x if isinstance(x, str) else x.decode(errors='replace') + nativestr = lambda x: x if isinstance(x, str) else x.decode('utf-8', 'replace') u = lambda x: x b = lambda x: x.encode('iso-8859-1') next = next |