1
1
import itertools
2
2
import time
3
- import six
4
3
5
4
from .document import Document
6
5
from .result import Result
@@ -308,9 +307,8 @@ def load_document(self, id):
308
307
Load a single document by id
309
308
"""
310
309
fields = self .client .hgetall (id )
311
- if six .PY3 :
312
- f2 = {to_string (k ): to_string (v ) for k , v in fields .items ()}
313
- fields = f2
310
+ f2 = {to_string (k ): to_string (v ) for k , v in fields .items ()}
311
+ fields = f2
314
312
315
313
try :
316
314
del fields ["id" ]
@@ -337,13 +335,13 @@ def info(self):
337
335
"""
338
336
339
337
res = self .client .execute_command (INFO_CMD , self .index_name )
340
- it = six . moves . map (to_string , res )
341
- return dict (six . moves . zip (it , it ))
338
+ it = map (to_string , res )
339
+ return dict (zip (it , it ))
342
340
343
341
def _mk_query_args (self , query ):
344
342
args = [self .index_name ]
345
343
346
- if isinstance (query , six . string_types ):
344
+ if isinstance (query , str ):
347
345
# convert the query from a text to a query object
348
346
query = Query (query )
349
347
if not isinstance (query , Query ):
@@ -448,7 +446,7 @@ def spellcheck(self, query, distance=None, include=None, exclude=None):
448
446
return corrections
449
447
450
448
for _correction in raw :
451
- if isinstance (_correction , six . integer_types ) and _correction == 0 :
449
+ if isinstance (_correction , int ) and _correction == 0 :
452
450
continue
453
451
454
452
if len (_correction ) != 3 :
0 commit comments