Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded backwards compatibility support #42

Merged
merged 2 commits into from
Jul 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 2 additions & 15 deletions django_pylibmc/memcached.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@

from django.conf import settings
from django.core.cache.backends.base import InvalidCacheBackendError
from django.core.cache.backends.memcached import BaseMemcachedCache
from django.core.cache.backends.memcached import BaseMemcachedCache, DEFAULT_TIMEOUT

try:
import pylibmc
from pylibmc import Error as MemcachedError
except ImportError:
raise InvalidCacheBackendError('Could not import pylibmc.')

try:
from django.core.cache.backends.memcached import DEFAULT_TIMEOUT
except ImportError:
DEFAULT_TIMEOUT = None


log = logging.getLogger('django.pylibmc')

Expand All @@ -45,20 +40,12 @@
if not pylibmc.support_compression:
warnings.warn('A compression level was provided but pylibmc was '
'not compiled with support for it.')
if not pylibmc.__version__ >= '1.3.0':
warnings.warn('A compression level was provided but pylibmc 1.3.0 '
'or above is required to handle this option.')


# Keyword arguments to configure compression options
# based on capabilities of a provided pylibmc library.
COMPRESS_KWARGS = {
# Requires pylibmc 1.0 and above. Given that the minumum supported
# version (as of now) is 1.1, the parameter is always included.
'min_compress_len': MIN_COMPRESS_LEN,
'compress_level': COMPRESS_LEVEL,
}
if pylibmc.__version__ >= '1.3.0':
COMPRESS_KWARGS['compress_level'] = COMPRESS_LEVEL


class PyLibMCCache(BaseMemcachedCache):
Expand Down