]> granicus.if.org Git - clang/commit
Portable Python script across Python version
authorSerge Guelton <sguelton@quarkslab.com>
Tue, 18 Dec 2018 16:04:21 +0000 (16:04 +0000)
committerSerge Guelton <sguelton@quarkslab.com>
Tue, 18 Dec 2018 16:04:21 +0000 (16:04 +0000)
commitbd8d3419e1b6a1c7ec82e1ceb1f22b407a38dac9
tree560bc893dd4d59a78b0bc277418faeb97299917c
parent38ed7e5d7917d18c9c7af9c49c5d83a112c6222a
Portable Python script across Python version

In Python3, dict.items, dict.keys, dict.values, zip, map and filter no longer return lists, they create generator instead.

The portability patch consists in forcing an extra `list` call if the result is actually used as a list.
`map` are replaced by list comprehension and `filter` by filtered list comprehension.

Differential Revision: https://reviews.llvm.org/D55197

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349501 91177308-0d34-0410-b5e6-96231b3b80d8
bindings/python/examples/cindex/cindex-dump.py
tools/scan-view/share/Reporter.py
tools/scan-view/share/ScanView.py
utils/ABITest/ABITestGen.py
utils/ABITest/TypeGen.py
utils/analyzer/CmpRuns.py
utils/analyzer/SATestBuild.py
utils/check_cfc/check_cfc.py
utils/check_cfc/obj_diff.py
utils/perf-training/perf-helper.py
www/builtins.py