blob: 2b077fce05b5605d5edc2a6b3f4518fc0cfb4b0d [file] [log] [blame] [edit]
#!/bin/bash -eu
# Copyright 2023 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
SITE_CUSTOMIZE_RPATH='cros/bazel/python/toolchains/sitecustomize.py'
SITE_CUSTOMIZE_DIR="$(dirname "$(rlocation "${SITE_CUSTOMIZE_RPATH}")")"
INTERP="$(rlocation python_interpreter/bin/python3)"
ARGS=("${INTERP}")
if [[ -n "${PYTHON_INTERACTIVE:-}" ]]; then
ARGS+=("-i")
unset PYTHON_INTERACTIVE
fi
PYTHONPATH="${SITE_CUSTOMIZE_DIR}:${PYTHONPATH:-}" exec "${ARGS[@]}" "$@"