fix: mysql db commands with subprocess

This commit is contained in:
Revant Nandgaonkar
2020-07-10 19:21:59 +05:30
parent 4598cb24f4
commit 21e2b13955
3 changed files with 12 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import subprocess
def run_command(command, stdout=None, stdin=None, stderr=None):
stdout = stdout or subprocess.PIPE
stderr = stderr or subprocess.PIPE
stdin = stdin or subprocess.PIPE
process = subprocess.Popen(command, stdout=stdout, stdin=stdin, stderr=stderr)
out, error = process.communicate()
if process.returncode: