code: def _nullify_stdio(self):
          
          fd = os.open('/dev/null', os.O_RDWR)
          try:
              for stdfd in (0, 1, 2):
                  if fd != stdfd:
                      os.dup2(fd, stdfd)
          finally:
              if fd not in (0, 1, 2):
                  os.close(fd)
docs: Open /dev/null to replace stdin, and stdout/stderr temporarily. In case
          of odd startup, assume we may be allocated a standard handle.