1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-03 09:42:22 +02:00

qconfig: Drop the try_expand() function

This is not used anymore, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2024-07-17 16:56:50 +01:00
parent 61d555d8a7
commit deedf65306

View File

@@ -29,7 +29,6 @@ import threading
import time
import unittest
import asteval
from buildman import bsettings
from buildman import kconfiglib
from buildman import toolchain
@@ -216,26 +215,6 @@ def read_file(fname, as_lines=True, skip_unicode=False):
print(f"Failed on file '{fname}: {exc}")
return None
def try_expand(line):
"""If value looks like an expression, try expanding it
Otherwise just return the existing value
"""
if line.find('=') == -1:
return line
try:
aeval = asteval.Interpreter( usersyms=SIZES, minimal=True )
cfg, val = re.split("=", line)
val= val.strip('\"')
if re.search(r'[*+-/]|<<|SZ_+|\(([^\)]+)\)', val):
newval = hex(aeval(val))
print(f'\tExpanded expression {val} to {newval}')
return cfg+'='+newval
except:
print(f'\tFailed to expand expression in {line}')
return line
### classes ###
class Progress: