autoninja: set PYTHONDONTWRITEBYTECODE=1 if not set

during build, lots of python scripts run and generates
lots of pycache *pyc in workspace.
To keep workspace clean, set PYTHONDONTWRITEBYTECODE=1
in autoninja.py

Change-Id: I5ce4c904aa11dd8172672ff9a8e9a06ebf69c9fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5599922
Reviewed-by: Erik Staab <estaab@chromium.org>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Philipp Wollermann <philwo@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gary Tong <gatong@chromium.org>
Reviewed-by: Gregory Guterman <guterman@google.com>
changes/22/5599922/3
Fumitoshi Ukai 9 months ago committed by LUCI CQ
parent 951578030e
commit e6d8f67fae

@ -207,6 +207,11 @@ def _gn_lines(output_dir, path):
def main(args):
# if user doesn't set PYTHONPYCACHEPREFIX and PYTHONDONTWRITEBYTECODE
# set PYTHONDONTWRITEBYTECODE=1 not to create many *.pyc in workspace
# and keep workspace clean.
if not os.environ.get("PYTHONPYCACHEPREFIX"):
os.environ.setdefault("PYTHONDONTWRITEBYTECODE", "1")
# The -t tools are incompatible with -j
t_specified = False
j_specified = False

Loading…
Cancel
Save