summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpfreixes <pfreixes@gmail.com>2016-06-14 23:59:19 +0200
committerpfreixes <pfreixes@gmail.com>2016-06-14 23:59:19 +0200
commitdd99ea7fc37b883a6bd2d618d7c99cae7e93ca7e (patch)
tree46ee9abc1a8959bca540bf3a43c14afd1664520f
parent934ff423c9503373f31a173fcb00591769ce7d40 (diff)
downloadredis-py-dd99ea7fc37b883a6bd2d618d7c99cae7e93ca7e.tar.gz
Fixed issues regarding Python3
-rwxr-xr-xredis/client.py8
-rw-r--r--tests/test_commands.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/redis/client.py b/redis/client.py
index 941bc85..a8aaa64 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -322,7 +322,7 @@ def parse_georadius_generic(response, **options):
if not options['withdist'] and not options['withcoord']\
and not options['withhash']:
# just a bunch of places
- return [str(r) for r in response_list]
+ return [nativestr(r) for r in response_list]
cast = {
'withdist': float,
@@ -332,10 +332,10 @@ def parse_georadius_generic(response, **options):
# zip all output results with each casting functino to get
# the properly native Python value.
- f = [str]
+ f = [nativestr]
f += [cast[o] for o in ['withdist', 'withhash', 'withcoord'] if options[o]]
return [
- map(lambda fv: fv[0](fv[1]), zip(f, r)) for r in response_list
+ list(map(lambda fv: fv[0](fv[1]), zip(f, r))) for r in response_list
]
@@ -444,7 +444,7 @@ class StrictRedis(object):
'CLUSTER SLAVES': parse_cluster_nodes,
'GEOPOS': lambda r: list(map(lambda ll: (float(ll[0]),
float(ll[1])), r)),
- 'GEOHASH': lambda r: list(map(str, r)),
+ 'GEOHASH': lambda r: list(map(nativestr, r)),
'GEORADIUS': parse_georadius_generic,
'GEORADIUSBYMEMBER': parse_georadius_generic,
}
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 8c5e9e5..06b19b7 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1523,7 +1523,7 @@ class TestRedisCommands(object):
r.geoadd('barcelona', *values)
r.georadius('barcelona', 2.191, 41.433, 1000, store='places_barcelona')
- assert r.zrange('places_barcelona', 0, -1) == ['place1']
+ assert r.zrange('places_barcelona', 0, -1) == [b'place1']
@skip_if_server_version_lt('3.2.0')
def test_georadius_store_dist(self, r):