code: def close (self):
          
          if self.child_fd == -1:
              return
  
          self.flush()
          os.close(self.child_fd)
          self.child_fd = -1
          self.closed = True
docs: Close the file descriptor.
  
          Calling this method a second time does nothing, but if the file
          descriptor was closed elsewhere, :class:`OSError` will be raised.