summaryrefslogtreecommitdiff
path: root/django/utils/datastructures.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2010-01-10 18:36:20 +0000
committerAdrian Holovaty <adrian@holovaty.com>2010-01-10 18:36:20 +0000
commit5ceed0a05388079118319940acdb2abe4ee01de6 (patch)
treec158b29638a509bef59fbbff164faf2749d35fe4 /django/utils/datastructures.py
parentbef891399ec278390ee148b0bb87d4c4140fc4c6 (diff)
downloaddjango-5ceed0a05388079118319940acdb2abe4ee01de6.tar.gz
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/utils/datastructures.py')
-rw-r--r--django/utils/datastructures.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py
index adcc3546d0..d6fc9dc56f 100644
--- a/django/utils/datastructures.py
+++ b/django/utils/datastructures.py
@@ -208,7 +208,7 @@ class MultiValueDict(dict):
try:
list_ = super(MultiValueDict, self).__getitem__(key)
except KeyError:
- raise MultiValueDictKeyError, "Key %r not found in %r" % (key, self)
+ raise MultiValueDictKeyError("Key %r not found in %r" % (key, self))
try:
return list_[-1]
except IndexError:
@@ -325,7 +325,7 @@ class MultiValueDict(dict):
Also accepts keyword args.
"""
if len(args) > 1:
- raise TypeError, "update expected at most 1 arguments, got %d" % len(args)
+ raise TypeError("update expected at most 1 arguments, got %d" % len(args))
if args:
other_dict = args[0]
if isinstance(other_dict, MultiValueDict):
@@ -336,7 +336,7 @@ class MultiValueDict(dict):
for key, value in other_dict.items():
self.setlistdefault(key, []).append(value)
except TypeError:
- raise ValueError, "MultiValueDict.update() takes either a MultiValueDict or dictionary"
+ raise ValueError("MultiValueDict.update() takes either a MultiValueDict or dictionary")
for key, value in kwargs.iteritems():
self.setlistdefault(key, []).append(value)
@@ -400,7 +400,7 @@ class ImmutableList(tuple):
if isinstance(self.warning, Exception):
raise self.warning
else:
- raise AttributeError, self.warning
+ raise AttributeError(self.warning)
# All list mutation functions complain.
__delitem__ = complain