def _close(self):
        """close all fds and do other cleanup actions"""
        for fd in self._fds:
            try:
                os.close(fd)
            except:
                pass
close all fds and do other cleanup actions
lib/mlpatches/modules/subprocess.py