diff options
author | Simon Glass | 2024-07-17 16:56:50 +0100 |
---|---|---|
committer | Simon Glass | 2024-07-26 08:01:06 -0600 |
commit | deedf6530616a1af4c45058cb7367c98c8948c5b (patch) | |
tree | f42c9ea0aa491ac4cd4c0f7481a0517b17b6a527 | |
parent | 61d555d8a741b7859c878fc34f9279413c4900c0 (diff) |
qconfig: Drop the try_expand() function
This is not used anymore, so drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rwxr-xr-x | tools/qconfig.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tools/qconfig.py b/tools/qconfig.py index 2492b37444a..7d3989c7c3e 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: |