From 1de154a14b66211d6569b96689be1f7e42aa43b6 Mon Sep 17 00:00:00 2001 From: ariel shtul Date: Thu, 30 Apr 2020 15:43:38 +0300 Subject: [PATCH] use six library for isinstance --- redisearch/_util.py | 2 +- redisearch/client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/redisearch/_util.py b/redisearch/_util.py index 31d0c96..d29e8d0 100644 --- a/redisearch/_util.py +++ b/redisearch/_util.py @@ -3,7 +3,7 @@ def to_string(s): if isinstance(s, six.string_types): return s - elif isinstance(s, bytes): + elif isinstance(s, six.binary_type): return s.decode('utf-8') else: return s # Not a string we care about diff --git a/redisearch/client.py b/redisearch/client.py index f6a5317..c092e50 100644 --- a/redisearch/client.py +++ b/redisearch/client.py @@ -439,7 +439,7 @@ def spellcheck(self, query, distance=None, include=None, exclude=None): return corrections for _correction in raw: - if isinstance(_correction, long) and _correction == 0: + if isinstance(_correction, six.integer_types) and _correction == 0: continue if len(_correction) != 3: