summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-10-19 06:50:49 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-10-19 06:50:49 (GMT)
commit784cd4cc543f3685bee3b5e65e78ad5b68d77e04 (patch)
treebf6e0a272192e1bf70ab763f18b6f8a2d08b5cdc /Lib
parentf3f283a1cbd8b87c911edc0e93baf3d0bfec672e (diff)
downloadcpython-784cd4cc543f3685bee3b5e65e78ad5b68d77e04.zip
cpython-784cd4cc543f3685bee3b5e65e78ad5b68d77e04.tar.gz
cpython-784cd4cc543f3685bee3b5e65e78ad5b68d77e04.tar.bz2
Make one function in packaging.metadata simpler
Diffstat (limited to 'Lib')
-rw-r--r--Lib/packaging/metadata.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/packaging/metadata.py b/Lib/packaging/metadata.py
index 9d3f8ab..2d0ffa4 100644
--- a/Lib/packaging/metadata.py
+++ b/Lib/packaging/metadata.py
@@ -185,6 +185,7 @@ _MISSING = object()
_FILESAFE = re.compile('[^A-Za-z0-9.]+')
+
class Metadata:
"""The metadata of a release.
@@ -228,10 +229,8 @@ class Metadata:
def __delitem__(self, name):
field_name = self._convert_name(name)
- try:
- del self._fields[field_name]
- except KeyError:
- raise KeyError(name)
+ # we let a KeyError propagate
+ del self._fields[field_name]
self._set_best_version()
def __contains__(self, name):