mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Fix hasattr for ImageTk.PhotoImage.__del__
This commit is contained in:
parent
87414b3f59
commit
11bcd5aaa9
|
@ -131,9 +131,10 @@ class PhotoImage:
|
|||
self.paste(image)
|
||||
|
||||
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