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