diff options
| author | Tim Graham <timograham@gmail.com> | 2017-09-02 19:59:45 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-09-22 12:51:17 -0400 |
| commit | e47b56d791eb6c81c6d83529b7a068959ea1c1ec (patch) | |
| tree | 9e3dfc877277ecf34351d415e79fa9269e8f26b2 /django/core/cache/backends/memcached.py | |
| parent | 87d2240e6cc594a3bf28dfdb2ec023c54fb76ff7 (diff) | |
Refs #20892 -- Removed support for passing pylibmc behavior settings as top-level attributes of CACHES['OPTIONS'].
Per deprecation timeline.
Diffstat (limited to 'django/core/cache/backends/memcached.py')
| -rw-r--r-- | django/core/cache/backends/memcached.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py index d49fd148fd..faaa36306f 100644 --- a/django/core/cache/backends/memcached.py +++ b/django/core/cache/backends/memcached.py @@ -3,10 +3,8 @@ import pickle import re import time -import warnings from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache -from django.utils.deprecation import RemovedInDjango21Warning from django.utils.functional import cached_property @@ -171,25 +169,6 @@ class PyLibMCCache(BaseMemcachedCache): import pylibmc super().__init__(server, params, library=pylibmc, value_not_found_exception=pylibmc.NotFound) - # The contents of `OPTIONS` was formerly only used to set the behaviors - # attribute, but is now passed directly to the Client constructor. As such, - # any options that don't match a valid keyword argument are removed and set - # under the `behaviors` key instead, to maintain backwards compatibility. - legacy_behaviors = {} - for option in list(self._options): - if option not in ('behaviors', 'binary', 'username', 'password'): - warnings.warn( - "Specifying pylibmc cache behaviors as a top-level property " - "within `OPTIONS` is deprecated. Move `%s` into a dict named " - "`behaviors` inside `OPTIONS` instead." % option, - RemovedInDjango21Warning, - stacklevel=2, - ) - legacy_behaviors[option] = self._options.pop(option) - - if legacy_behaviors: - self._options.setdefault('behaviors', {}).update(legacy_behaviors) - @cached_property def _cache(self): return self._lib.Client(self._servers, **self._options) |
