Make sure /dev/null isn't open for the entire process

This commit is contained in:
Paul Romano 2015-04-16 12:52:00 -05:00
parent 1c3ac71bab
commit db61158325

View file

@ -3,9 +3,6 @@ import subprocess
import os
FNULL = open(os.devnull, 'w')
class Executor(object):
@ -34,7 +31,8 @@ class Executor(object):
subprocess.check_call('openmc -p', shell=True,
cwd=self._working_directory)
else:
subprocess.check_call('openmc -p', shell=True, stdout=FNULL,
subprocess.check_call('openmc -p', shell=True,
stdout=open(os.devnull, 'w'),
cwd=self._working_directory)
@ -69,5 +67,6 @@ class Executor(object):
subprocess.check_call(command, shell=True,
cwd=self._working_directory)
else:
subprocess.check_call(command, shell=True, stdout=FNULL,
subprocess.check_call(command, shell=True,
stdout=open(os.devnull, 'w'),
cwd=self._working_directory)