From db61158325580aaea3c895cd96d5bc04619459ff Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 16 Apr 2015 12:52:00 -0500 Subject: [PATCH] Make sure /dev/null isn't open for the entire process --- src/utils/openmc/executor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/utils/openmc/executor.py b/src/utils/openmc/executor.py index f2d26de9b6..abc2e9e49e 100644 --- a/src/utils/openmc/executor.py +++ b/src/utils/openmc/executor.py @@ -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)