test/bin/python: support Python3
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Родитель
d95134c991
Коммит
ede6c7e278
|
@ -17,8 +17,12 @@ cat >/dev/null
|
|||
|
||||
# verify the python compiles at least. if this fails then the python code passed
|
||||
# to -c failed basic syntax checks.
|
||||
# Compiler package ws removed in Py3
|
||||
# see https://www.python.org/dev/peps/pep-3108/#id53
|
||||
# The closest replacement is the ast package
|
||||
# https://docs.python.org/3/library/ast.html
|
||||
echo "$2" |
|
||||
/usr/bin/python2.7 -c "import sys; __import__('compiler').parse(sys.stdin.read())"
|
||||
/usr/bin/python3 -c "import sys; __import__('ast').parse(sys.stdin.read())"
|
||||
|
||||
# pretend we found zero processes.
|
||||
echo 0
|
||||
|
|
Загрузка…
Ссылка в новой задаче