Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/gruntworker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <github@rebertia.com>2014-12-07 03:22:09 +0300
committerChris Rebert <github@rebertia.com>2014-12-07 03:22:09 +0300
commit1c5207952e94149eb9692601c7aa8fc02fcc944c (patch)
tree167b871e8b447995d22c36af0e06ccf130bdbabd
parenta9c4a6da5f611045504e528bf90a9f9a8f19e36e (diff)
use subprocess.DEVNULL
-rwxr-xr-xgruntworker.py6
1 files 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):