Skip to content

Commit ede6c7e

Browse files
committed
test/bin/python: support Python3
Signed-off-by: Robin H. Johnson <[email protected]>
1 parent d95134c commit ede6c7e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/bin/python

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ cat >/dev/null
1717

1818
# verify the python compiles at least. if this fails then the python code passed
1919
# to -c failed basic syntax checks.
20+
# Compiler package ws removed in Py3
21+
# see https://www.python.org/dev/peps/pep-3108/#id53
22+
# The closest replacement is the ast package
23+
# https://docs.python.org/3/library/ast.html
2024
echo "$2" |
21-
/usr/bin/python2.7 -c "import sys; __import__('compiler').parse(sys.stdin.read())"
25+
/usr/bin/python3 -c "import sys; __import__('ast').parse(sys.stdin.read())"
2226

2327
# pretend we found zero processes.
2428
echo 0

0 commit comments

Comments
 (0)