mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Make one function in packaging.metadata simpler
This commit is contained in:
parent
f3f283a1cb
commit
784cd4cc54
1 changed files with 3 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue