Skip to content

Commit

Permalink
ImageFileDirectory_v1 does not raise KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 7, 2019
1 parent f3ed44a commit ef16cb8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/PIL/Image.py
Expand Up @@ -3327,19 +3327,13 @@ def has_key(self, tag):
return tag in self

def __setitem__(self, tag, value):
if self._info is not None:
try:
del self._info[tag]
except KeyError:
pass
if self._info is not None and tag in self._info:
del self._info[tag]
self._data[tag] = value

def __delitem__(self, tag):
if self._info is not None:
try:
del self._info[tag]
except KeyError:
pass
if self._info is not None and tag in self._info:
del self._info[tag]
del self._data[tag]

def __iter__(self):
Expand Down

0 comments on commit ef16cb8

Please sign in to comment.