diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2019-06-07 17:49:05 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2019-06-09 14:00:25 +0200 |
| commit | c295c312dd76be6b61bdaccda5b70be9cb79cf5f (patch) | |
| tree | a4c414134407a04a9227582fb5a97f8762bd5ed8 /guiconfig.py | |
| parent | 929a5981c717d2e72e4b181b1a81d0b181d6b411 (diff) | |
menuconfig/guiconfig: Clean up 'range' checking a bit
Just cosmetic.
Diffstat (limited to 'guiconfig.py')
| -rwxr-xr-x | guiconfig.py | 10 |
1 files changed, 4 insertions, 6 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 |
