diff options
author | Guy Benoish <guy.benoish@redislabs.com> | 2019-01-23 11:51:33 +0200 |
---|---|---|
committer | Guy Benoish <guy.benoish@redislabs.com> | 2019-01-23 12:31:57 +0200 |
commit | c219c4792f6a135f41a429eb341a934768f435a0 (patch) | |
tree | 24db23182990e4102721b1ae8ceba1f3ab8d9ad9 | |
parent | f9cb36af086510cab95e84a1e75d7f09d508040e (diff) | |
download | redis-py-c219c4792f6a135f41a429eb341a934768f435a0.tar.gz |
GEOHASH response may contain None elements
-rwxr-xr-x | redis/client.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py index 656df26..f7bf192 100755 --- a/redis/client.py +++ b/redis/client.py @@ -244,6 +244,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 @@ -508,7 +514,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)), |