mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix safe_eval on Python 3.8.
This commit is contained in:
parent
02f51e865c
commit
3f387f225c
1 changed files with 8 additions and 0 deletions
|
@ -90,6 +90,14 @@ def safe_eval(expr, locals=None, include_exceptions=False):
|
|||
)
|
||||
)
|
||||
|
||||
# And in Python 3.6 too, although not encountered until Python 3.8, see https://bugs.python.org/issue32892
|
||||
if sys.version_info[:2] >= (3, 6):
|
||||
SAFE_NODES.update(
|
||||
set(
|
||||
(ast.Constant,)
|
||||
)
|
||||
)
|
||||
|
||||
filter_list = []
|
||||
for filter_ in filter_loader.all():
|
||||
filter_list.extend(filter_.filters().keys())
|
||||
|
|
Loading…
Reference in a new issue