MCPcopy Index your code
hub / github.com/python/cpython / newFDs

Method newFDs

Lib/test/test_socket.py:4042–4052  ·  view source on GitHub ↗
(self, n)

Source from the content-addressed store, hash-verified

4040 badfd = -0x5555
4041
4042 def newFDs(self, n):
4043 # Return a list of n file descriptors for newly-created files
4044 # containing their list indices as ASCII numbers.
4045 fds = []
4046 for i in range(n):
4047 fd, path = tempfile.mkstemp()
4048 self.addCleanup(os.unlink, path)
4049 self.addCleanup(os.close, fd)
4050 os.write(fd, str(i).encode())
4051 fds.append(fd)
4052 return fds
4053
4054 def checkFDs(self, fds):
4055 # Check that the file descriptors in the given list contain

Callers 5

createAndSendFDsMethod · 0.95
_testFDPassSimpleMethod · 0.95
_testFDPassSeparateMethod · 0.95

Calls 5

strFunction · 0.85
addCleanupMethod · 0.80
writeMethod · 0.45
encodeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected