From: Simon Glass Date: Wed, 17 Jul 2024 15:56:50 +0000 (+0100) Subject: qconfig: Drop the try_expand() function X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=deedf6530616a1af4c45058cb7367c98c8948c5b;p=u-boot.git qconfig: Drop the try_expand() function This is not used anymore, so drop it. Signed-off-by: Simon Glass --- diff --git a/tools/qconfig.py b/tools/qconfig.py index 2492b37444..7d3989c7c3 100755 --- a/tools/qconfig.py +++ b/tools/qconfig.py @@ -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: