Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions guiconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,23 +1844,23 @@ def _check_valid(dialog, entry, sym, s):
# Returns True if the string 's' is a well-formed value for 'sym'.
# Otherwise, pops up an error and returns False.

if sym.type not in (INT, HEX):
if sym.orig_type not in (INT, HEX):
# Anything goes for non-int/hex symbols
return True

base = 10 if sym.type == INT else 16
base = 10 if sym.orig_type == INT else 16
try:
int(s, base)
except ValueError:
messagebox.showerror(
"Bad value",
"'{}' is a malformed {} value".format(s, TYPE_TO_STR[sym.type]),
"'{}' is a malformed {} value".format(s, TYPE_TO_STR[sym.orig_type]),
parent=dialog,
)
entry.focus_set()
return False

for low_sym, high_sym, cond in sym.ranges:
for low_sym, high_sym, cond, _ in sym.ranges:
if expr_value(cond):
low_s = low_sym.str_value
high_s = high_sym.str_value
Expand All @@ -1883,8 +1883,8 @@ def _range_info(sym):
# Returns a string with information about the valid range for the symbol
# 'sym', or None if 'sym' doesn't have a range

if sym.type in (INT, HEX):
for low, high, cond in sym.ranges:
if sym.orig_type in (INT, HEX):
for low, high, cond, _ in sym.ranges:
if expr_value(cond):
return "Range: {}-{}".format(low.str_value, high.str_value)

Expand Down
4 changes: 2 additions & 2 deletions menuconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -4104,7 +4104,7 @@ def _check_valid(sym, s):
_error("'{}' is a malformed {} value".format(s, TYPE_TO_STR[sym.orig_type]))
return False

for low_sym, high_sym, cond in sym.ranges:
for low_sym, high_sym, cond, _ in sym.ranges:
if expr_value(cond):
low_s = low_sym.str_value
high_s = high_sym.str_value
Expand All @@ -4123,7 +4123,7 @@ def _range_info(sym):
# 'sym', or None if 'sym' doesn't have a range

if sym.orig_type in (INT, HEX):
for low, high, cond in sym.ranges:
for low, high, cond, _ in sym.ranges:
if expr_value(cond):
return "Range: {}-{}".format(low.str_value, high.str_value)

Expand Down