diff --git a/lib/ansible/plugins/test/core.py b/lib/ansible/plugins/test/core.py index 1c3a570ce42..2cd96a1b430 100644 --- a/lib/ansible/plugins/test/core.py +++ b/lib/ansible/plugins/test/core.py @@ -120,8 +120,7 @@ def regex(value='', pattern='', ignorecase=False, multiline=False, match_type='s if multiline: flags |= re.M _re = re.compile(pattern, flags=flags) - _bool = __builtins__.get('bool') - return _bool(getattr(_re, match_type, 'search')(value)) + return bool(getattr(_re, match_type, 'search')(value)) def match(value, pattern='', ignorecase=False, multiline=False):