From c219c4792f6a135f41a429eb341a934768f435a0 Mon Sep 17 00:00:00 2001 From: Guy Benoish Date: Wed, 23 Jan 2019 11:51:33 +0200 Subject: GEOHASH response may contain None elements --- redis/client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)), -- cgit v1.2.1