Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions easybuild/tools/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, on_error=WARN):
"""
Return (first) path in $PATH for specified command, or None if command is not found

Expand All @@ -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)

Expand Down