mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Catch AttributeError for BitmapImage.__photo
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
11bcd5aaa9
commit
b9d1768561
|
@ -219,9 +219,10 @@ class BitmapImage:
|
|||
self.__photo = tkinter.BitmapImage(data=image.tobitmap(), **kw)
|
||||
|
||||
def __del__(self) -> None:
|
||||
if not hasattr(self, "__photo"):
|
||||
try:
|
||||
name = self.__photo.name
|
||||
except AttributeError:
|
||||
return
|
||||
name = self.__photo.name
|
||||
self.__photo.name = None
|
||||
try:
|
||||
self.__photo.tk.call("image", "delete", name)
|
||||
|
|
Loading…
Reference in New Issue
Block a user