summaryrefslogtreecommitdiff
path: root/django/core/cache/backends/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/cache/backends/base.py')
-rw-r--r--django/core/cache/backends/base.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py
index 76e98a25b6..a07a34e3b5 100644
--- a/django/core/cache/backends/base.py
+++ b/django/core/cache/backends/base.py
@@ -234,14 +234,16 @@ class BaseCache(object):
cache code.
"""
if len(key) > MEMCACHE_MAX_KEY_LENGTH:
- warnings.warn('Cache key will cause errors if used with memcached: '
- '%r (longer than %s)' % (key, MEMCACHE_MAX_KEY_LENGTH),
- CacheKeyWarning)
+ warnings.warn(
+ 'Cache key will cause errors if used with memcached: %r '
+ '(longer than %s)' % (key, MEMCACHE_MAX_KEY_LENGTH), CacheKeyWarning
+ )
for char in key:
if ord(char) < 33 or ord(char) == 127:
- warnings.warn('Cache key contains characters that will cause '
- 'errors if used with memcached: %r' % key,
- CacheKeyWarning)
+ warnings.warn(
+ 'Cache key contains characters that will cause errors if '
+ 'used with memcached: %r' % key, CacheKeyWarning
+ )
break
def incr_version(self, key, delta=1, version=None):