OSDN Git Service

Subzero: Change the echoing in shellcmd().
authorJim Stichnoth <stichnot@chromium.org>
Tue, 30 Sep 2014 17:52:04 +0000 (10:52 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Tue, 30 Sep 2014 17:52:04 +0000 (10:52 -0700)
This makes it much easier to copy/paste the output.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/611983003

pydir/utils.py

index 33b58e9..1141e3e 100644 (file)
@@ -3,11 +3,11 @@ import subprocess
 import sys
 
 def shellcmd(command, echo=True):
-    if echo: print '[cmd]', command
-
     if not isinstance(command, str):
         command = ' '.join(command)
 
+    if echo: print '[cmd]', command
+
     stdout_result = subprocess.check_output(command, shell=True)
     if echo: sys.stdout.write(stdout_result)
     return stdout_result