8000 Reverted 'allow_not_rounded' changes and action Serhiy's recommendation · python/cpython@fc07de8 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc07de8

Browse files
committed
Reverted 'allow_not_rounded' changes and action Serhiy's recommendation
1 parent 1c8759c commit fc07de8

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Lib/tkinter/test/test_tkinter/test_widgets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,8 @@ def test_digits(self):
936936

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

941942
def test_label(self):
942943
widget = self.create()

Lib/tkinter/test/widget_tests.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,9 @@ def checkIntegerParam(self, widget, name, *values, **kwargs):
101101
self.checkInvalidParam(widget, name, 3.2,
102102
errmsg='expected integer but got "3.2"')
103103

104-
def checkFloatParam(self, widget, name, *values, conv=float, allow_not_rounded=False, **kwargs):
104+
def checkFloatParam(self, widget, name, *values, conv=float, **kwargs):
105105
for value in values:
106-
try:
107-
self.checkParam(widget, name, value, conv=conv, **kwargs)
108-
except AssertionError:
109-
if allow_not_rounded:
110-
self.checkParam(widget, name, value, conv=lambda val: val, **kwargs)
111-
else:
112-
raise
106+
self.checkParam(widget, name, value, conv=conv, **kwargs)
113107
self.checkInvalidParam(widget, name, '',
114108
errmsg='expected floating-point number but got ""')
115109
self.checkInvalidParam(widget, name, 'spam',

0 commit comments

Comments
 (0)
0