From deedf6530616a1af4c45058cb7367c98c8948c5b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 17 Jul 2024 16:56:50 +0100 Subject: [PATCH] qconfig: Drop the try_expand() function This is not used anymore, so drop it. Signed-off-by: Simon Glass --- tools/qconfig.py | 21 --------------------- 1 file changed, 21 deletions(-) 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: -- 2.39.5