From c3acae5c2eb1cb9f7d81c2cbfaf2361cc8daca7d Mon Sep 17 00:00:00 2001 From: Simon Branford Date: Sun, 11 Jun 2023 09:16:06 +0100 Subject: [PATCH 1/2] remove deprecated log_error option from which command --- easybuild/tools/filetools.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/easybuild/tools/filetools.py b/easybuild/tools/filetools.py index 8848edcc89..dc40d8e41d 100644 --- a/easybuild/tools/filetools.py +++ b/easybuild/tools/filetools.py @@ -484,7 +484,7 @@ def extract_file(fn, dest, cmd=None, extra_options=None, overwrite=False, forced return base_dir -def which(cmd, retain_all=False, check_perms=True, log_ok=True, log_error=None, on_error=None): +def which(cmd, retain_all=False, check_perms=True, log_ok=True, log_error=None, on_error=WARN): """ Return (first) path in $PATH for specified command, or None if command is not found @@ -493,17 +493,6 @@ def which(cmd, retain_all=False, check_perms=True, log_ok=True, log_error=None, :param log_ok: Log an info message where the command has been found (if any) :param on_error: What to do if the command was not found, default: WARN. Possible values: IGNORE, WARN, ERROR """ - if log_error is not None: - _log.deprecated("'log_error' named argument in which function has been replaced by 'on_error'", '5.0') - # If set, make sure on_error is at least WARN - if log_error and on_error == IGNORE: - on_error = WARN - elif not log_error and on_error is None: # If set to False, use IGNORE unless on_error is also set - on_error = IGNORE - # Set default - # TODO: After removal of log_error from the parameters, on_error=WARN can be used instead of this - if on_error is None: - on_error = WARN if on_error not in (IGNORE, WARN, ERROR): raise EasyBuildError("Invalid value for 'on_error': %s", on_error) From 2e2e32810f8fe03db0733ae26f309c867cb5a590 Mon Sep 17 00:00:00 2001 From: Simon Branford Date: Sun, 11 Jun 2023 09:19:09 +0100 Subject: [PATCH 2/2] actually remove the option --- easybuild/tools/filetools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/tools/filetools.py b/easybuild/tools/filetools.py index dc40d8e41d..17a13b75a5 100644 --- a/easybuild/tools/filetools.py +++ b/easybuild/tools/filetools.py @@ -484,7 +484,7 @@ def extract_file(fn, dest, cmd=None, extra_options=None, overwrite=False, forced return base_dir -def which(cmd, retain_all=False, check_perms=True, log_ok=True, log_error=None, on_error=WARN): +def which(cmd, retain_all=False, check_perms=True, log_ok=True, on_error=WARN): """ Return (first) path in $PATH for specified command, or None if command is not found