From 1664be94387ccb3088f4176bf4b701c68796ef50 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 18 Nov 2020 12:51:55 -0800 Subject: [PATCH] Fix: no need to decode() after redis client scan, so it will work for both python2 and python3 (#96) The original code was tested in python2, which convert a str to a unicode str. It is working but not needed. --- src/swsssdk/configdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/swsssdk/configdb.py b/src/swsssdk/configdb.py index 85764ad38fee..1a67db06f325 100644 --- a/src/swsssdk/configdb.py +++ b/src/swsssdk/configdb.py @@ -413,7 +413,7 @@ def __get_config(self, client, pipe, data, cursor): cur: poition of next item to scan """ cur, keys = client.scan(cursor=cursor, match='*', count=self.REDIS_SCAN_BATCH_SIZE) - keys = [key.decode() for key in keys if key != self.INIT_INDICATOR] + keys = [key for key in keys if key != self.INIT_INDICATOR] for key in keys: pipe.hgetall(key) records = pipe.execute()