MCPcopy Index your code
hub / github.com/RustPython/RustPython / newFDs

Method newFDs

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

Source from the content-addressed store, hash-verified

3937 badfd = -0x5555
3938
3939 def newFDs(self, n):
3940 # Return a list of n file descriptors for newly-created files
3941 # containing their list indices as ASCII numbers.
3942 fds = []
3943 for i in range(n):
3944 fd, path = tempfile.mkstemp()
3945 self.addCleanup(os.unlink, path)
3946 self.addCleanup(os.close, fd)
3947 os.write(fd, str(i).encode())
3948 fds.append(fd)
3949 return fds
3950
3951 def checkFDs(self, fds):
3952 # 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