#!/bin/sh
# py-compile - Compile a Python program
-scriptversion=2020-02-19.23; # UTC
+scriptversion=2021-02-27.01; # UTC
# Copyright (C) 2000-2021 Free Software Foundation, Inc.
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
-if [ -z "$PYTHON" ]; then
+if test -z "$PYTHON"; then
PYTHON=python
fi
files=$*
if test -z "$files"; then
- usage_error "no files given"
+ usage_error "no files given"
fi
# if basedir was given, then it should be prepended to filenames before
# byte compilation.
-if [ -z "$basedir" ]; then
- pathtrans="path = file"
+if test -z "$basedir"; then
+ pathtrans="path = file"
else
- pathtrans="path = os.path.join('$basedir', file)"
+ pathtrans="path = os.path.join('$basedir', file)"
fi
# if destdir was given, then it needs to be prepended to the filename to
# byte compile but not go into the compiled file.
-if [ -z "$destdir" ]; then
- filetrans="filepath = path"
+if test -z "$destdir"; then
+ filetrans="filepath = path"
else
- filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
+ filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
fi
python_major=`$PYTHON -V 2>&1 | sed -e 's/.* //;s/\..*$//;1q'`
py_compile.compile(filepath, $import_call(filepath$import_arg2), path)
else:
py_compile.compile(filepath, filepath + 'o', path)
-sys.stdout.write('\n')" 2>/dev/null || :
+sys.stdout.write('\n')" 2>/dev/null || exit $?
# Local Variables:
# mode: shell-script