فهرست منبع

Redis pop bytes

transfer bytes to str
newlyedward 9 سال پیش
والد
کامیت
2a45003117
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      DB/RedisClient.py

+ 3 - 2
DB/RedisClient.py

@@ -48,7 +48,7 @@ class RedisClient(object):
         pop an item
         :return:
         """
-        return self.__conn.spop(self.name)
+        return self.__conn.spop(self.name).decode('utf-8')                    #redis return bytes
 
     def delete(self, value):
         """
@@ -77,9 +77,10 @@ if __name__ == '__main__':
     # print(redis_con.getAll())
     # redis_con.delete('abc')
     # print(redis_con.getAll())
-    # redis_con.pop()
+
     # print(redis_con.getAll())
     redis_con.changeTable('raw_proxy')
+    redis_con.pop()
 
     # redis_con.put('132.112.43.221:8888')
     # redis_con.changeTable('proxy')