summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2019-01-27 11:00:34 -0800
committerGitHub <noreply@github.com>2019-01-27 11:00:34 -0800
commitdde0a48b670bd5bfc43eb8eb814d2a0cb9162b88 (patch)
tree73f4715fb18ba1ede5532edc9fd3ea1e21a8bbd4
parentaaf6e6b7157ffd8aca426540b471895ca25d2bf4 (diff)
parentc219c4792f6a135f41a429eb341a934768f435a0 (diff)
downloadredis-py-dde0a48b670bd5bfc43eb8eb814d2a0cb9162b88.tar.gz
Merge pull request #1126 from guybe7/geohash_fix
GEOHASH response may contain None elements
-rwxr-xr-xredis/client.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py
index 1f96246..1e7dfc4 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -246,6 +246,12 @@ def int_or_none(response):
return int(response)
+def string_or_none(response):
+ if response is None:
+ return None
+ return nativestr(response)
+
+
def parse_stream_list(response):
if response is None:
return None
@@ -510,7 +516,7 @@ class Redis(object):
'CONFIG RESETSTAT': bool_ok,
'CONFIG SET': bool_ok,
'DEBUG OBJECT': parse_debug_object,
- 'GEOHASH': lambda r: list(map(nativestr, r)),
+ 'GEOHASH': lambda r: list(map(string_or_none, r)),
'GEOPOS': lambda r: list(map(lambda ll: (float(ll[0]),
float(ll[1]))
if ll is not None else None, r)),