def alter_subprocess_kwargs_by_platform(**kwargs):
 kwargs.setdefault('close_fds', (os.name == 'posix'))
 if (os.name == 'nt'):
  CONSOLE_CREATION_FLAGS = 0
  CREATE_NO_WINDOW = 134217728
  CONSOLE_CREATION_FLAGS |= CREATE_NO_WINDOW
  kwargs.setdefault('creationflags', CONSOLE_CREATION_FLAGS)
 return kwargs

def alter_subprocess_kwargs_by_platform ( ** kwargs ) : kwargs . setdefault ( 'close_fds' , ( os . name == 'posix' ) ) if ( os . name == 'nt' ) : CONSOLE_CREATION_FLAGS = 0 CREATE_NO_WINDOW = 134217728 CONSOLE_CREATION_FLAGS |= CREATE_NO_WINDOW kwargs . setdefault ( 'creationflags' , CONSOLE_CREATION_FLAGS ) return kwargs
given a dict .