From 1c5207952e94149eb9692601c7aa8fc02fcc944c Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sat, 6 Dec 2014 16:22:09 -0800 Subject: use subprocess.DEVNULL --- gruntworker.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gruntworker.py b/gruntworker.py index 97bf49a..70cbe6b 100755 --- a/gruntworker.py +++ b/gruntworker.py @@ -2,8 +2,7 @@ # coding=utf-8 from sys import exit -from os import devnull as DEV_NULL -from subprocess import check_call, check_output, CalledProcessError +from subprocess import check_call, check_output, DEVNULL, CalledProcessError from shutil import rmtree from datetime import datetime @@ -16,8 +15,7 @@ def log(*args): def run_expecting_success(cmd): log("\trunning:", b' '.join(cmd).decode('utf8', 'replace')) - with open(DEV_NULL) as void: - check_call(cmd, stdin=void) + check_call(cmd, stdin=DEVNULL) def run_for_output(cmd): -- cgit v1.2.3