Don't write pyc files if running from Cog

Many tools use vpython so we can avoid pyc writes by
disabling them at this layer.

Bug: b/320565954
Change-Id: I50cd04968810ecc186d5abe6c67e54ae1647c739
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5812665
Commit-Queue: Erik Staab <estaab@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
changes/65/5812665/3
Erik Staab 1 year ago committed by LUCI CQ
parent 7cd18db3c3
commit c1457823a0

@ -37,6 +37,11 @@ fi
export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "$0")}"
export DEPOT_TOOLS_UNAME_S="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}"
# Don't write pyc files if running from a Cog workspace.
if [[ "$(pwd)" == "/google/cog/"* ]]; then
export PYTHONDONTWRITEBYTECODE=1
fi
source "${DEPOT_TOOLS_DIR}/cipd_bin_setup.sh"
CIPD_ROOT=$(cipd_bin_setup) &> /dev/null

Loading…
Cancel
Save