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)))

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 ) ) )
set stdout and stderr to be blocking .