Skip to content

Commit cc93c06

Browse files
committed
use ERROR/IGNORE/WARN constants directly in apply_regex_substitutions
1 parent c697690 commit cc93c06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

easybuild/tools/filetools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
from easybuild.tools import run
5959
# import build_log must stay, to use of EasyBuildLog
6060
from easybuild.tools.build_log import EasyBuildError, dry_run_msg, print_msg, print_warning
61-
from easybuild.tools.config import (DEFAULT_WAIT_ON_LOCK_INTERVAL, GENERIC_EASYBLOCK_PKG, build_option, install_path,
62-
IGNORE, WARN, ERROR)
61+
from easybuild.tools.config import DEFAULT_WAIT_ON_LOCK_INTERVAL, ERROR, GENERIC_EASYBLOCK_PKG, IGNORE, WARN
62+
from easybuild.tools.config import build_option, install_path
6363
from easybuild.tools.py2vs3 import HTMLParser, std_urllib, string_type
6464
from easybuild.tools.utilities import natural_keys, nub, remove_unwanted_chars
6565

@@ -1479,7 +1479,7 @@ def apply_regex_substitutions(paths, regex_subs, backup='.orig.eb', on_missing_m
14791479
"""
14801480
if on_missing_match is None:
14811481
on_missing_match = build_option('strict')
1482-
allowed_values = (run.ERROR, run.WARN, run.IGNORE)
1482+
allowed_values = (ERROR, IGNORE, WARN)
14831483
if on_missing_match not in allowed_values:
14841484
raise EasyBuildError('Invalid value passed to on_missing_match: %s (allowed: %s)',
14851485
on_missing_match, ', '.join(allowed_values))
@@ -1535,9 +1535,9 @@ def apply_regex_substitutions(paths, regex_subs, backup='.orig.eb', on_missing_m
15351535
_log.info('Applied the following substitutions to %s:\n%s', path, '\n'.join(replacement_msgs))
15361536
else:
15371537
msg = 'Nothing found to replace in %s' % path
1538-
if on_missing_match == run.ERROR:
1538+
if on_missing_match == ERROR:
15391539
raise EasyBuildError(msg)
1540-
elif on_missing_match == run.WARN:
1540+
elif on_missing_match == WARN:
15411541
_log.warning(msg)
15421542
else:
15431543
_log.info(msg)

0 commit comments

Comments
 (0)