diff options
Diffstat (limited to 'django/core/cache/backends/base.py')
| -rw-r--r-- | django/core/cache/backends/base.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py index ae83865db8..4b7806fc29 100644 --- a/django/core/cache/backends/base.py +++ b/django/core/cache/backends/base.py @@ -52,10 +52,11 @@ def get_key_func(key_func): class BaseCache(object): def __init__(self, params): timeout = params.get('timeout', params.get('TIMEOUT', 300)) - try: - timeout = int(timeout) - except (ValueError, TypeError): - timeout = 300 + if timeout is not None: + try: + timeout = int(timeout) + except (ValueError, TypeError): + timeout = 300 self.default_timeout = timeout options = params.get('OPTIONS', {}) |
