mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
ImageFileDirectory_v1 does not raise KeyError
This commit is contained in:
parent
f3ed44a566
commit
ef16cb8efe
|
@ -3327,19 +3327,13 @@ class Exif(MutableMapping):
|
||||||
return tag in self
|
return tag in self
|
||||||
|
|
||||||
def __setitem__(self, tag, value):
|
def __setitem__(self, tag, value):
|
||||||
if self._info is not None:
|
if self._info is not None and tag in self._info:
|
||||||
try:
|
|
||||||
del self._info[tag]
|
del self._info[tag]
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
self._data[tag] = value
|
self._data[tag] = value
|
||||||
|
|
||||||
def __delitem__(self, tag):
|
def __delitem__(self, tag):
|
||||||
if self._info is not None:
|
if self._info is not None and tag in self._info:
|
||||||
try:
|
|
||||||
del self._info[tag]
|
del self._info[tag]
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
del self._data[tag]
|
del self._data[tag]
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user