From 793229652d4a4c0e02c05271bad33336c8b80056 Mon Sep 17 00:00:00 2001 From: Corey Goldberg Date: Wed, 9 Dec 2015 08:23:28 -0500 Subject: [PATCH] fix redirect subprocess output to dev/null --- xvfbwrapper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xvfbwrapper.py b/xvfbwrapper.py index d61b9ae..f8cbce4 100644 --- a/xvfbwrapper.py +++ b/xvfbwrapper.py @@ -47,7 +47,10 @@ class Xvfb: def start(self): self.vdisplay_num = self.search_for_free_display() self.xvfb_cmd = ['Xvfb', ':%d' % self.vdisplay_num] + self.xvfb_cmd - self.proc = subprocess.Popen(self.xvfb_cmd) + with open(os.devnull, 'w') as fnull: + self.proc = subprocess.Popen(self.xvfb_cmd, + stdout=fnull, + stderr=fnull) time.sleep(0.2) # give Xvfb time to start ret_code = self.proc.poll() if ret_code is None: