diff options
| -rwxr-xr-x | guiconfig.py | 10 | ||||
| -rwxr-xr-x | menuconfig.py | 10 |
2 files changed, 8 insertions, 12 deletions
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 diff --git a/menuconfig.py b/menuconfig.py index 77558eb..cfcfbef 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -3077,14 +3077,12 @@ def _check_valid(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): _error("{} is outside the range {}-{}" - .format(s, low_sym.str_value, high_sym.str_value)) - + .format(s, low_s, high_s)) return False break |
