[Python-checkins] distutils2: The error message should contain the key as given, not normalized.

eric.araujo python-checkins at python.org
Mon Nov 14 17:29:01 CET 2011


http://hg.python.org/distutils2/rev/7eb32e910b85
changeset:   1250:7eb32e910b85
user:        Éric Araujo <merwok at netwok.org>
date:        Mon Nov 14 17:06:10 2011 +0100
summary:
  The error message should contain the key as given, not normalized.

Backout of 8f69359881aa.  Reported by Jeremy Kloth.

files:
  distutils2/metadata.py |  6 ++++--
  1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/distutils2/metadata.py b/distutils2/metadata.py
--- a/distutils2/metadata.py
+++ b/distutils2/metadata.py
@@ -230,8 +230,10 @@
 
     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):

-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list