From 84544ee8fd69b1345b969d89335f49c085a4fecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= Date: Tue, 13 Dec 2016 16:37:39 +0100 Subject: [PATCH] Fix AST nodes for Python 3 and enable dependent test_uri (#18597) * Enable tests on python 3 for uri * Added one more node type to SAFE_NODES into safe_eval module. ast.USub represents unary operators. This is necessary for parsing some unusual but still valid JSON files during testing with Python 3. --- lib/ansible/template/safe_eval.py | 1 + test/utils/shippable/python3-test-tag-blacklist.txt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/template/safe_eval.py b/lib/ansible/template/safe_eval.py index dd41b3a3816..76df7ed11e2 100644 --- a/lib/ansible/template/safe_eval.py +++ b/lib/ansible/template/safe_eval.py @@ -69,6 +69,7 @@ def safe_eval(expr, locals={}, include_exceptions=False): ast.Name, ast.Str, ast.Sub, + ast.USub, ast.Tuple, ast.UnaryOp, ) diff --git a/test/utils/shippable/python3-test-tag-blacklist.txt b/test/utils/shippable/python3-test-tag-blacklist.txt index 97c8d8f86ff..849074ada29 100644 --- a/test/utils/shippable/python3-test-tag-blacklist.txt +++ b/test/utils/shippable/python3-test-tag-blacklist.txt @@ -1,3 +1,2 @@ test_hg test_service -test_uri