Skip to content

Commit 36ad946

Browse files
committed
Raise ValueError if slidermin/max incompatible.
1 parent a4694a0 commit 36ad946

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/widgets.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,13 @@ def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
328328
"""
329329
AxesWidget.__init__(self, ax)
330330

331+
if slidermin is not None and not hasattr(slidermin, 'val'):
332+
raise ValueError("Argument slidermin ({}) has no 'val'"
333+
.format(type(slidermin)))
334+
if slidermax is not None and not hasattr(slidermax, 'val'):
335+
raise ValueError("Argument slidermax ({}) has no 'val'"
336+
.format(type(slidermax)))
337+
331338
self.valmin = valmin
332339
self.valmax = valmax
333340
self.val = valinit

0 commit comments

Comments
 (0)