diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index aedf709cfa..7ffeee72e5 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -74,7 +74,7 @@ class MultiValueDict(dict): try: list_ = dict.__getitem__(self, key) except KeyError: - raise MultiValueDictKeyError, "Key %r not found in MultiValueDict %r" % (key, self) + raise MultiValueDictKeyError, "Key %r not found in %r" % (key, self) try: return list_[-1] except IndexError: @@ -189,10 +189,10 @@ class DotExpandedDict(dict): current[bits[-1]] = v except TypeError: # Special-case if current isn't a dict. current = {bits[-1] : v} - -def dot_expand(key_to_list_mapping, dict_factory=dict): + +def dot_expand(key_to_list_mapping, dict_factory=dict): top = dict_factory() - + for k, v in key_to_list_mapping.items(): current = top bits = k.split('.') @@ -203,4 +203,4 @@ def dot_expand(key_to_list_mapping, dict_factory=dict): current[bits[-1]] = v except TypeError: # Special-case if current isn't a dict. current = dict_factory( (bits[-1], v) ) - return top \ No newline at end of file + return top \ No newline at end of file diff --git a/tests/othertests/httpwrappers.py b/tests/othertests/httpwrappers.py index 0564ee04f0..e3aa7c4e42 100644 --- a/tests/othertests/httpwrappers.py +++ b/tests/othertests/httpwrappers.py @@ -8,7 +8,7 @@ >>> q['foo'] Traceback (most recent call last): ... -MultiValueDictKeyError: "Key 'foo' not found in MultiValueDict {}" +MultiValueDictKeyError: "Key 'foo' not found in " >>> q['something'] = 'bar' Traceback (most recent call last): @@ -86,7 +86,7 @@ AttributeError: This QueryDict instance is immutable >>> q['foo'] Traceback (most recent call last): ... -MultiValueDictKeyError: "Key 'foo' not found in MultiValueDict {}" +MultiValueDictKeyError: "Key 'foo' not found in " >>> q['name'] = 'john' @@ -186,7 +186,7 @@ True >>> q['bar'] Traceback (most recent call last): ... -MultiValueDictKeyError: "Key 'bar' not found in MultiValueDict {'foo': ['bar']}" +MultiValueDictKeyError: "Key 'bar' not found in " >>> q['something'] = 'bar' Traceback (most recent call last):