def call_megam(args):
 if isinstance(args, compat.string_types):
  raise TypeError('args should be a list of strings')
 if (_megam_bin is None):
  config_megam()
 cmd = ([_megam_bin] + args)
 p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
 (stdout, stderr) = p.communicate()
 if (p.returncode != 0):
  print()
  print(stderr)
  raise OSError('megam command failed!')
 if isinstance(stdout, compat.string_types):
  return stdout
 else:
  return stdout.decode('utf-8')

def call_megam ( args ) : if isinstance ( args , compat . string_types ) : raise TypeError ( 'args should be a list of strings' ) if ( _megam_bin is None ) : config_megam ( ) cmd = ( [ _megam_bin ] + args ) p = subprocess . Popen ( cmd , stdout = subprocess . PIPE ) ( stdout , stderr ) = p . communicate ( ) if ( p . returncode != 0 ) : print ( ) print ( stderr ) raise OSError ( 'megam command failed!' ) if isinstance ( stdout , compat . string_types ) : return stdout else : return stdout . decode ( 'utf-8' )
call the megam binary with the given arguments .