tests: Remove check for os.set_inheritable
This is available on all supported Python versions. Change-Id: I76a696e56e04ec47b107af8e169c04138cf45fbb Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
parent
eb1fdd8abc
commit
d95fd8ac61
@ -269,10 +269,7 @@ def fork_exec(cmd,
|
|||||||
os.dup2(fptr.fileno(), desc)
|
os.dup2(fptr.fileno(), desc)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
if pass_fds and hasattr(os, 'set_inheritable'):
|
if pass_fds:
|
||||||
# os.set_inheritable() is only available and needed
|
|
||||||
# since Python 3.4. On Python 3.3 and older, file descriptors are
|
|
||||||
# inheritable by default.
|
|
||||||
for fd in pass_fds:
|
for fd in pass_fds:
|
||||||
os.set_inheritable(fd, True)
|
os.set_inheritable(fd, True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user