Skip to content

Commit

Permalink
0820
Browse files Browse the repository at this point in the history
  • Loading branch information
tian50 committed Aug 20, 2021
1 parent 08c1382 commit 7a338ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions msgpi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7a338ab

Please sign in to comment.