Two things changed in Python 3.4:
- 'basestring' is no longer defined, so use six.string_types
- True/False are now special AST node types (NamedConstant) rather than
just names
(Good thing we had tests, or I wouldn't have noticed the 2nd thing!)
I found only one place where safe_eval() is called inside the ansible
codebase: in lib/template/__init__.py. The call to safe_eval(result,
...) is protected by result.startswith('...'), which means result cannot
possibly be a byte string on Python 3 (or startswith() would raise, so
six.string_types (which excludes byte strings on Python 3) is fine here.
| Name |
Last commit
|
Last update |
|---|---|---|
| bin | Loading commit data... | |
| contrib | Loading commit data... | |
| docs/man | Loading commit data... | |
| docsite | Loading commit data... | |
| examples | Loading commit data... | |
| hacking | Loading commit data... | |
| lib/ansible | Loading commit data... | |
| packaging | Loading commit data... | |
| samples | Loading commit data... | |
| test | Loading commit data... | |
| ticket_stubs | Loading commit data... | |
| .coveragerc | Loading commit data... | |
| .gitattributes | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| CHANGELOG.md | Loading commit data... | |
| CODING_GUIDELINES.md | Loading commit data... | |
| CONTRIBUTING.md | Loading commit data... | |
| COPYING | Loading commit data... | |
| ISSUE_TEMPLATE.md | Loading commit data... | |
| MANIFEST.in | Loading commit data... | |
| Makefile | Loading commit data... | |
| README.md | Loading commit data... | |
| RELEASES.txt | Loading commit data... | |
| VERSION | Loading commit data... | |
| setup.py | Loading commit data... | |
| test-requirements.txt | Loading commit data... | |
| tox.ini | Loading commit data... |