From ed0649d6594668fef99375d849d4a0622aa9c2f8 Mon Sep 17 00:00:00 2001 From: Rnhmjoj Date: Tue, 24 Mar 2015 23:45:02 +0100 Subject: [PATCH] Use builtin /dev/null pipe --- pirate-get.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pirate-get.py b/pirate-get.py index 5bc4820..cf85734 100755 --- a/pirate-get.py +++ b/pirate-get.py @@ -427,11 +427,12 @@ def main(): args = parser.parse_args() if args.transmission: - with open('/dev/null') as dn: - ret = subprocess.call(['transmission-remote', '-l'], stdout=dn, stderr=dn) - if ret != 0: - print('Transmission is not running.') - return + ret = subprocess.call(['transmission-remote', '-l'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + if ret != 0: + print('Transmission is not running.') + return if args.list_categories: cur_color = 'zebra_0'