The error message should contain the key as given, not normalized.

Backout of 2e047702df7f.  Reported by Jeremy Kloth.
This commit is contained in:
Éric Araujo 2011-11-14 19:45:30 +01:00
parent 618b73035a
commit acc0952ff8
1 changed files with 4 additions and 2 deletions

View File

@ -229,8 +229,10 @@ class Metadata:
def __delitem__(self, name):
field_name = self._convert_name(name)
# we let a KeyError propagate
del self._fields[field_name]
try:
del self._fields[field_name]
except KeyError:
raise KeyError(name)
self._set_best_version()
def __contains__(self, name):