diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 18:36:20 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 18:36:20 +0000 |
| commit | 5ceed0a05388079118319940acdb2abe4ee01de6 (patch) | |
| tree | c158b29638a509bef59fbbff164faf2749d35fe4 /django/core/cache | |
| parent | bef891399ec278390ee148b0bb87d4c4140fc4c6 (diff) | |
Changed a whole bunch of places to raise exception instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/cache')
| -rw-r--r-- | django/core/cache/__init__.py | 4 | ||||
| -rw-r--r-- | django/core/cache/backends/base.py | 2 | ||||
| -rw-r--r-- | django/core/cache/backends/filebased.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py index 739d3c4834..1b602908cb 100644 --- a/django/core/cache/__init__.py +++ b/django/core/cache/__init__.py @@ -39,10 +39,10 @@ def parse_backend_uri(backend_uri): (scheme, host, params) tuple. """ if backend_uri.find(':') == -1: - raise InvalidCacheBackendError, "Backend URI must start with scheme://" + raise InvalidCacheBackendError("Backend URI must start with scheme://") scheme, rest = backend_uri.split(':', 1) if not rest.startswith('//'): - raise InvalidCacheBackendError, "Backend URI must start with scheme://" + raise InvalidCacheBackendError("Backend URI must start with scheme://") host = rest[2:] qpos = rest.find('?') diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py index 720f5bdf6f..d6f07ef6f0 100644 --- a/django/core/cache/backends/base.py +++ b/django/core/cache/backends/base.py @@ -71,7 +71,7 @@ class BaseCache(object): ValueError exception. """ if key not in self: - raise ValueError, "Key '%s' not found" % key + raise ValueError("Key '%s' not found" % key) new_value = self.get(key) + delta self.set(key, new_value) return new_value diff --git a/django/core/cache/backends/filebased.py b/django/core/cache/backends/filebased.py index 181197a8d7..87baf8b53f 100644 --- a/django/core/cache/backends/filebased.py +++ b/django/core/cache/backends/filebased.py @@ -129,7 +129,7 @@ class CacheClass(BaseCache): try: os.makedirs(self._dir) except OSError: - raise EnvironmentError, "Cache directory '%s' does not exist and could not be created'" % self._dir + raise EnvironmentError("Cache directory '%s' does not exist and could not be created'" % self._dir) def _key_to_file(self, key): """ |
