Skip to content

Commit 2eae2a0

Browse files
committed
Fix bugs
1 parent d4ce44b commit 2eae2a0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

flask_pymemcache.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ def check_key(self, key):
7272

7373

7474
class FlaskPyMemcache(object):
75-
#: :type: memcache.Client
76-
client = None
7775

7876
def __init__(self, app=None, conf_key=None):
7977
"""
@@ -89,14 +87,14 @@ def init_app(self, app, conf_key=None):
8987
:type app: flask.Flask
9088
:parm str conf_key: Key of flask config.
9189
"""
92-
conf_key = conf_key or self.conf_key or 'MEMCACHE'
90+
conf_key = conf_key or self.conf_key or 'PYMEMCACHE'
9391
self.conf_key = conf_key
9492
conf = app.config[conf_key]
9593
if not isinstance(conf, dict):
9694
raise TypeError("Flask-PyMemcache conf should be dict")
9795

9896
close_on_teardown = conf.pop('close_on_teardown', False)
99-
client = FlaskPyMemcache(**conf)
97+
client = FlaskMemcacheClient(**conf)
10098
app.extensions[self] = client
10199

102100
if close_on_teardown:
@@ -109,4 +107,4 @@ def client(self):
109107
"""
110108
:rtype: pymemcache.client.Client
111109
"""
112-
return current_app.extensions[self]
110+
return flask.current_app.extensions[self]

0 commit comments

Comments
 (0)