diff --git a/msgpi/utils.py b/msgpi/utils.py index 30a2701..f668fa1 100644 --- a/msgpi/utils.py +++ b/msgpi/utils.py @@ -15,10 +15,9 @@ def run(cmd, timeout, scrnout): proc = sbp.Popen(cmd) else: if platform.system() == 'Windows': - FNULL = open(os.devnull, 'w') - proc = sbp.Popen(cmd, stdout=FNULL, stderr=sbp.STDOUT) + proc = sbp.Popen(cmd, stdout=sbp.DEVNULL, stderr=sbp.STDOUT) elif platform.system() == 'Linux': - proc = sbp.Popen(cmd, stdout=sbp.DEVNULL, stderr=sbp.STDOUT,preexec_fn=os.setsid) + proc = sbp.Popen(cmd, stdout=sbp.DEVNULL, stderr=sbp.STDOUT, preexec_fn=os.setsid) try: stdout, stderr = proc.communicate(timeout=timeout)