Do not pass open file descriptors to Xvfb

Explicitly pass close_fds=True so that Xvfb does not inherit the open file descriptors of the calling process.
This commit is contained in:
Alexey Kotlyarov 2015-12-21 13:32:13 +11:00
parent 7bb52b9ab9
commit b30b75ebc5
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ class Xvfb:
with open(os.devnull, 'w') as fnull:
self.proc = subprocess.Popen(self.xvfb_cmd,
stdout=fnull,
stderr=fnull)
stderr=fnull,
close_fds=True)
time.sleep(0.2) # give Xvfb time to start
ret_code = self.proc.poll()
if ret_code is None: