Index: tools/telemetry/telemetry/util/cloud_storage.py |
diff --git a/tools/telemetry/telemetry/util/cloud_storage.py b/tools/telemetry/telemetry/util/cloud_storage.py |
index a40b524b6f5aeb4af2fbcfae6477aa1cfa20a60f..3e8163abc62f42c60f714fca6e34f0506f8ff478 100644 |
--- a/tools/telemetry/telemetry/util/cloud_storage.py |
+++ b/tools/telemetry/telemetry/util/cloud_storage.py |
@@ -135,9 +135,15 @@ def _RunCommand(args): |
gsutil_env = os.environ.copy() |
gsutil_env['HOME'] = _CROS_GSUTIL_HOME_WAR |
- gsutil = subprocess.Popen([sys.executable, gsutil_path] + args, |
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
- env=gsutil_env) |
+ if os.name == 'nt': |
+ # If Windows, prepend python. Python scripts aren't directly executable. |
+ args = [sys.executable, gsutil_path] + args |
+ else: |
+ # Don't do it on POSIX, in case someone is using a shell script to redirect. |
+ args = [gsutil_path] + args |
+ |
+ gsutil = subprocess.Popen(args, stdout=subprocess.PIPE, |
+ stderr=subprocess.PIPE, env=gsutil_env) |
stdout, stderr = gsutil.communicate() |
if gsutil.returncode: |