code: def set_std_streams_blocking():
      
      if not fcntl:
          return
      for f in (sys.__stdout__, sys.__stderr__):
          fileno = f.fileno()
          flags = fcntl.fcntl(fileno, fcntl.F_GETFL)
          fcntl.fcntl(fileno, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)
docs: Set stdout and stderr to be blocking.
  
      This is called after Popen.communicate() to revert stdout and stderr back
      to be blocking (the default) in the event that the process to which they
      were passed manipulated one or both file descriptors to be non-blocking.