Skip to content

Commit e2575bb

Browse files
authored
Merge pull request #4276 from branfosj/log_error
remove deprecated `log_error` option from `which` function
2 parents bf25660 + 2e2e328 commit e2575bb

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

easybuild/tools/filetools.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def extract_file(fn, dest, cmd=None, extra_options=None, overwrite=False, forced
486486
return base_dir
487487

488488

489-
def which(cmd, retain_all=False, check_perms=True, log_ok=True, log_error=None, on_error=None):
489+
def which(cmd, retain_all=False, check_perms=True, log_ok=True, on_error=WARN):
490490
"""
491491
Return (first) path in $PATH for specified command, or None if command is not found
492492
@@ -495,17 +495,6 @@ def which(cmd, retain_all=False, check_perms=True, log_ok=True, log_error=None,
495495
:param log_ok: Log an info message where the command has been found (if any)
496496
:param on_error: What to do if the command was not found, default: WARN. Possible values: IGNORE, WARN, ERROR
497497
"""
498-
if log_error is not None:
499-
_log.deprecated("'log_error' named argument in which function has been replaced by 'on_error'", '5.0')
500-
# If set, make sure on_error is at least WARN
501-
if log_error and on_error == IGNORE:
502-
on_error = WARN
503-
elif not log_error and on_error is None: # If set to False, use IGNORE unless on_error is also set
504-
on_error = IGNORE
505-
# Set default
506-
# TODO: After removal of log_error from the parameters, on_error=WARN can be used instead of this
507-
if on_error is None:
508-
on_error = WARN
509498
if on_error not in (IGNORE, WARN, ERROR):
510499
raise EasyBuildError("Invalid value for 'on_error': %s", on_error)
511500

0 commit comments

Comments
 (0)