mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #18571: Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
This commit is contained in:
parent
46e1ce214b
commit
daf455554b
51 changed files with 1448 additions and 317 deletions
|
@ -2,7 +2,11 @@
|
|||
|
||||
# Initial tests are copied as is from "test_poll.py"
|
||||
|
||||
import os, select, random, unittest, sys
|
||||
import os
|
||||
import random
|
||||
import select
|
||||
import sys
|
||||
import unittest
|
||||
from test.support import TESTFN, run_unittest
|
||||
|
||||
try:
|
||||
|
@ -111,6 +115,11 @@ class DevPollTests(unittest.TestCase):
|
|||
self.assertRaises(ValueError, devpoll.register, fd, fd, select.POLLIN)
|
||||
self.assertRaises(ValueError, devpoll.unregister, fd)
|
||||
|
||||
def test_fd_non_inheritable(self):
|
||||
devpoll = select.devpoll()
|
||||
self.addCleanup(devpoll.close)
|
||||
self.assertEqual(os.get_inheritable(devpoll.fileno()), False)
|
||||
|
||||
|
||||
def test_main():
|
||||
run_unittest(DevPollTests)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue