bpo-39152: add missing ttk.Scale.configure return value (GH-17815)
tkinter.ttk.Scale().configure([name]) now returns a configuration tuple for name
or a list thereof for all options. Based on patch Giovanni Lombardo.
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index 573544d..c7c71cd 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -1084,11 +1084,12 @@
Setting a value for any of the "from", "from_" or "to" options
generates a <<RangeChanged>> event."""
- if cnf:
+ retval = Widget.configure(self, cnf, **kw)
+ if not isinstance(cnf, (type(None), str)):
kw.update(cnf)
- Widget.configure(self, **kw)
if any(['from' in kw, 'from_' in kw, 'to' in kw]):
self.event_generate('<<RangeChanged>>')
+ return retval
def get(self, x=None, y=None):