fix: pipe uncompressed database to file

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay D. Pai
2020-07-10 10:07:22 +05:30
parent c67fc02452
commit 1d9dd966b1
2 changed files with 10 additions and 9 deletions

View File

@@ -1,8 +1,10 @@
import subprocess
def run_command(command):
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def run_command(command, stdout=None, stderr=None):
stdout = stdout or subprocess.PIPE
stderr = stderr or subprocess.PIPE
process = subprocess.Popen(command, stdout=stdout, stderr=stderr)
out, error = process.communicate()
if process.returncode:
print("Something went wrong:")