Revert "metrics: Use vpython3 instead of sys.executable"
This reverts commit 310e1e814d729f68deac5f6c5f21f377c2883dac.
Reason for revert:
"vpython3" doesn't work on Windows without shell
Original change's description:
> metrics: Use vpython3 instead of sys.executable
>
> Apparently, uploading metrics might happen after sys.executable
> has been deleted.
>
> Bug: 1068263
> Change-Id: Id4ab465bb97d146b688f42fb2002e29372e65555
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2148879
> Commit-Queue: Anthony Polito <apolito@google.com>
> Reviewed-by: Anthony Polito <apolito@google.com>
TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
Change-Id: I6b9998de0d3afeda142971f889361fb1c8a37a0d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1068263
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2149762
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
diff --git a/metrics.py b/metrics.py
index 4df1a8e..7b8d04a 100644
--- a/metrics.py
+++ b/metrics.py
@@ -184,7 +184,7 @@
# We invoke a subprocess, and use stdin.write instead of communicate(),
# so that we are able to return immediately, leaving the upload running in
# the background.
- p = subprocess.Popen(['vpython3', UPLOAD_SCRIPT], stdin=subprocess.PIPE)
+ p = subprocess.Popen([sys.executable, UPLOAD_SCRIPT], stdin=subprocess.PIPE)
p.stdin.write(json.dumps(self._reported_metrics).encode('utf-8'))
def _collect_metrics(self, func, command_name, *args, **kwargs):