--- a/thirdparty/rietveld/upload.py Sat Dec 06 16:52:21 2008 +0000
+++ b/thirdparty/rietveld/upload.py Sat Dec 06 19:25:01 2008 +0000
@@ -151,7 +151,6 @@
Returns:
The authentication token returned by ClientLogin.
"""
- # account_type = "GOOGLE"
account_type = "HOSTED_OR_GOOGLE"
if self.host.endswith(".google.com"):
# Needed for use inside Google.
@@ -510,19 +509,20 @@
def RunShellWithReturnCode(command, print_output=False,
universal_newlines=True):
- """Executes a command and returns the output and the return code.
+ """Executes a command and returns the output from stdout and the return code.
Args:
command: Command to execute.
print_output: If True, the output is printed to stdout.
+ If False, both stdout and stderr are ignored.
universal_newlines: Use universal_newlines flag (default: True).
Returns:
Tuple (output, return code)
"""
logging.info("Running %s", command)
- p = subprocess.Popen(command, stdout=subprocess.PIPE, shell=use_shell,
- universal_newlines=universal_newlines)
+ p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ shell=use_shell, universal_newlines=universal_newlines)
if print_output:
output_array = []
while True:
@@ -535,7 +535,11 @@
else:
output = p.stdout.read()
p.wait()
+ errout = p.stderr.read()
+ if print_output and errout:
+ print >>sys.stderr, errout
p.stdout.close()
+ p.stderr.close()
return output, p.returncode