Commit c07721a2 by Timothée Peignier

Merge pull request #166 from estebistec/better-cmd-error

better cmd error
parents 8d8bfc53 06844897
...@@ -232,7 +232,11 @@ class SubProcessCompressor(CompressorBase): ...@@ -232,7 +232,11 @@ class SubProcessCompressor(CompressorBase):
def execute_command(self, command, content): def execute_command(self, command, content):
pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stdin=subprocess.PIPE, stderr=subprocess.PIPE) stdin=subprocess.PIPE, stderr=subprocess.PIPE)
try:
pipe.stdin.write(smart_str(content)) pipe.stdin.write(smart_str(content))
except IOError, e:
message = "Unable to pipe content to command: %s" % command
raise CompressorError(message, e)
pipe.stdin.close() pipe.stdin.close()
compressed_content = pipe.stdout.read() compressed_content = pipe.stdout.read()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment