diff options
author | Éric Araujo <merwok@netwok.org> | 2011-11-14 18:45:30 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-11-14 18:45:30 (GMT) |
commit | acc0952ff841941fa289a759414af20c04810311 (patch) | |
tree | 8b7b63afbd0030b3a990542b5c8a125f0226ee3e /Lib/packaging | |
parent | 618b73035a7f209de86d257f46c0a58ca221970b (diff) | |
download | cpython-acc0952ff841941fa289a759414af20c04810311.zip cpython-acc0952ff841941fa289a759414af20c04810311.tar.gz cpython-acc0952ff841941fa289a759414af20c04810311.tar.bz2 |
The error message should contain the key as given, not normalized.
Backout of 2e047702df7f. Reported by Jeremy Kloth.
Diffstat (limited to 'Lib/packaging')
-rw-r--r-- | Lib/packaging/metadata.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/packaging/metadata.py b/Lib/packaging/metadata.py index 2d0ffa4..2993ebb 100644 --- a/Lib/packaging/metadata.py +++ b/Lib/packaging/metadata.py @@ -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): |