summaryrefslogtreecommitdiff
path: root/indra/lib/python
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2010-06-21 10:43:33 -0400
committerNat Goodspeed <nat@lindenlab.com>2010-06-21 10:43:33 -0400
commitbef22c0325cbfeb3d290753a66ecf862bf4593d3 (patch)
tree98fd8a3e0f18facd662a8eaf846ceb927b49e71e /indra/lib/python
parenta069e0d3db0e0771e54768a702fa18e57415992e (diff)
parentc2b1bf6a0d7fbcadc81ef375fd8f2a9944758e64 (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-release/
Diffstat (limited to 'indra/lib/python')
-rw-r--r--indra/lib/python/indra/util/llmanifest.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py
index 7e5b86c53f..c33a03034a 100644
--- a/indra/lib/python/indra/util/llmanifest.py
+++ b/indra/lib/python/indra/util/llmanifest.py
@@ -39,6 +39,7 @@ import shutil
import sys
import tarfile
import errno
+import subprocess
def path_ancestors(path):
drive, path = os.path.splitdrive(os.path.normpath(path))
@@ -366,20 +367,23 @@ class LLManifest(object):
def run_command(self, command):
""" Runs an external command, and returns the output. Raises
- an exception if the command reurns a nonzero status code. For
- debugging/informational purpoases, prints out the command's
+ an exception if the command returns a nonzero status code. For
+ debugging/informational purposes, prints out the command's
output as it is received."""
print "Running command:", command
- fd = os.popen(command, 'r')
+ sys.stdout.flush()
+ child = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+ shell=True)
lines = []
while True:
- lines.append(fd.readline())
+ lines.append(child.stdout.readline())
if lines[-1] == '':
break
else:
print lines[-1],
output = ''.join(lines)
- status = fd.close()
+ child.stdout.close()
+ status = child.wait()
if status:
raise RuntimeError(
"Command %s returned non-zero status (%s) \noutput:\n%s"