6 eventlet.monkey_patch()
10 p = subprocess.Popen(['ls'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
11 # the following line creates a _SocketDuckForFd(3) and .close()s it, but the
12 # object has not been collected by the GC yet
15 f = open('/dev/null', 'rb') # f.fileno() == 3
16 gc.collect() # this calls the __del__ of _SocketDuckForFd(3), close()ing it again
18 f.close() # OSError, because the fd 3 has already been closed
21 if __name__ == '__main__':