bpo-31135: Call the parent destroy() method even if the used
attribute doesn't exist.
The LabeledScale.destroy() method now also explicitly clears label
and scale attributes to help the garbage collector to destroy all
widgets.
pass
else:
del self._variable
- Frame.destroy(self)
+ Frame.destroy(self)
+ self.label = None
+ self.scale = None
def _adjust(self, *args):
def destroy(self):
"""Destroy this widget and its associated variable."""
- del self._variable
+ try:
+ del self._variable
+ except AttributeError:
+ pass
Menubutton.destroy(self)
--- /dev/null
+ttk: Fix LabeledScale and OptionMenu destroy() method. Call the parent
+destroy() method even if the used attribute doesn't exist. The
+LabeledScale.destroy() method now also explicitly clears label and scale
+attributes to help the garbage collector to destroy all widgets.