From d1f234180bd91e619b42f490c67b73fd05cfbd3f Mon Sep 17 00:00:00 2001 From: mjrao Date: Tue, 28 Feb 2017 13:54:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81py2=20=E7=8E=AF=E5=A2=83=20?= =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Py3Cache.py | 7 +++++-- Readme.md | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Py3Cache.py b/Py3Cache.py index 72ab8f4..92791f5 100644 --- a/Py3Cache.py +++ b/Py3Cache.py @@ -7,7 +7,6 @@ Python Implements Level 2 Cache Broker import sys import json import uuid -import configparser import redis import pickle import threading @@ -15,7 +14,11 @@ import threading from beaker.cache import CacheManager from beaker.util import parse_cache_config_options - +if sys.version < '3': + import ConfigParser as configparser +else: + import configparser + def py3cache_empty(): return None diff --git a/Readme.md b/Readme.md index 2d9dd2e..9197ed4 100644 --- a/Readme.md +++ b/Readme.md @@ -15,8 +15,8 @@ Py3Cache 使用 Redis 的 Pub/Sub 进行缓存事件分发。目前的功能还 ### 环境要求 * Python 3 -* Beaker (一级缓存) -* PyRedis (二级缓存) +* Beaker (一级缓存)(`pip install beaker`) +* PyRedis (二级缓存)(`pip install redis`) * Pickle (序列化器) * Redis (服务) -- Gitee