diff --git a/macros.pybytecompile b/macros.pybytecompile index f36cdbf..38ac84a 100644 --- a/macros.pybytecompile +++ b/macros.pybytecompile @@ -28,6 +28,8 @@ py3_byte_compile () {\ PYTHONPATH="%{_rpmconfigdir}/redhat" $python_binary -s -B -m compileall2 -o 0 -o 1 -s $RPM_BUILD_ROOT -p / $bytecode_compilation_path \ }\ \ +# Path to intepreter should not contain any arguments \ +[[ "%1" =~ " -" ]] && echo "ERROR py_byte_compile: Path to interpreter should not contain any arguments" >&2 && exit 1 \ # Get version without a dot (36 instead of 3.6), bash doesn't compare floats well \ python_version=$(%1 -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") \ # compileall2 Python module is not compatible with Python < 3.4 \