From c295c312dd76be6b61bdaccda5b70be9cb79cf5f Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 7 Jun 2019 17:49:05 +0200 Subject: menuconfig/guiconfig: Clean up 'range' checking a bit Just cosmetic. --- guiconfig.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'guiconfig.py') diff --git a/guiconfig.py b/guiconfig.py index ca04e06..7ce3cb1 100755 --- a/guiconfig.py +++ b/guiconfig.py @@ -1308,15 +1308,13 @@ def _check_valid(dialog, entry, sym, s): for low_sym, high_sym, cond in sym.ranges: if expr_value(cond): - low = int(low_sym.str_value, base) - val = int(s, base) - high = int(high_sym.str_value, base) + low_s = low_sym.str_value + high_s = high_sym.str_value - if not low <= val <= high: + if not int(low_s, base) <= int(s, base) <= int(high_s, base): messagebox.showerror( "Value out of range", - "{} is outside the range {}-{}".format( - s, low_sym.str_value, high_sym.str_value), + "{} is outside the range {}-{}".format(s, low_s, high_s), parent=dialog) entry.focus_set() return False -- cgit v1.2.3