Skip to content

Commit

Permalink
Reverted 'allow_not_rounded' changes and action Serhiy's recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
E-Paine committed Aug 3, 2020
1 parent 1c8759c commit fc07de8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Lib/tkinter/test/test_tkinter/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,8 @@ def test_digits(self):

def test_from(self):
widget = self.create()
self.checkFloatParam(widget, 'from', 100, 14.9, 15.1, conv=float_round, allow_not_rounded=True)
# A change in Tk 8.6.10 means `from` is not rounded (bpo-41306)
self.checkFloatParam(widget, 'from', 100, 14.9, 15.1, conv=float_round if get_tk_patchlevel() < (8, 6, 10) else noconv)

def test_label(self):
widget = self.create()
Expand Down
10 changes: 2 additions & 8 deletions Lib/tkinter/test/widget_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,9 @@ def checkIntegerParam(self, widget, name, *values, **kwargs):
self.checkInvalidParam(widget, name, 3.2,
errmsg='expected integer but got "3.2"')

def checkFloatParam(self, widget, name, *values, conv=float, allow_not_rounded=False, **kwargs):
def checkFloatParam(self, widget, name, *values, conv=float, **kwargs):
for value in values:
try:
self.checkParam(widget, name, value, conv=conv, **kwargs)
except AssertionError:
if allow_not_rounded:
self.checkParam(widget, name, value, conv=lambda val: val, **kwargs)
else:
raise
self.checkParam(widget, name, value, conv=conv, **kwargs)
self.checkInvalidParam(widget, name, '',
errmsg='expected floating-point number but got ""')
self.checkInvalidParam(widget, name, 'spam',
Expand Down

0 comments on commit fc07de8

Please sign in to comment.