From bbb600eefc4ed42fe8e379074827399649b19d2e Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Mon, 2 Sep 2024 22:17:00 -0500 Subject: [PATCH] [SCons] Remove unused code and other minor fixes --- site_scons/buildutils.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/site_scons/buildutils.py b/site_scons/buildutils.py index 5763235da5..5678910520 100644 --- a/site_scons/buildutils.py +++ b/site_scons/buildutils.py @@ -1145,7 +1145,7 @@ def compiler_flag_list( cc_flags = [] for flag in flags: if flag in cc_flags: - continue + continue if not any(re.match(exclude, flag) for exclude in excludes): cc_flags.append(flag) @@ -1212,9 +1212,8 @@ def listify(value: "Union[str, Iterable]") -> "List[str]": """ if isinstance(value, str): return value.split() - else: - # Already a sequence. Return as a list - return list(value) + # Already a sequence. Return as a list + return list(value) def remove_file(name: "TPathLike") -> None: @@ -1233,19 +1232,6 @@ def remove_directory(name: "TPathLike") -> None: shutil.rmtree(path_name) -def ipdb(): - """ - Break execution and drop into an IPython debug shell at the point - where this function is called. - """ - from IPython.core.debugger import Pdb - from IPython.core import getipython - - ip = getipython.get_ipython() - def_colors = ip.colors - Pdb(def_colors).set_trace(sys._getframe().f_back) - - def get_spawn(env: "SCEnvironment"): """ A replacement for env['SPAWN'] on Windows that can deal with very long @@ -1306,6 +1292,7 @@ def get_command_output(cmd: str, *args: str, ignore_errors=False): ) return data.stdout.strip() + _python_info = None def setup_python_env(env): """Set up an environment for compiling Python extension modules""" @@ -1393,6 +1380,7 @@ def setup_python_env(env): return env + def get_pip_install_location( python_cmd: str, user: bool = False,