Commit c55b0ca6 authored by Guido van Rossum's avatar Guido van Rossum

Put a try-except around the "image delete" call in Image.__del__ to

avoid tracebacks when the root is destroyed before the image object.
parent 7f1653c0
......@@ -1827,7 +1827,11 @@ class Image:
def __str__(self): return self.name
def __del__(self):
if self.name:
try:
self.tk.call('image', 'delete', self.name)
except TclError:
# May happen if the root was destroyed
pass
def __setitem__(self, key, value):
self.tk.call(self.name, 'configure', '-'+key, value)
def __getitem__(self, key):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment