(arg, flavor)
return "'" + arg.replace("'", "'" + '"\'"' + "'")  + "'"
Quote a string such that it will be interpreted as a single argument
  by the shell.
Quote a string such that it will be interpreted as a single argument
  by the shell.
Quote a string such that it will be interpreted as a single argument by the shell .
def QuoteShellArgument(arg, flavor):
  """Quote a string such that it will be interpreted as a single argument
  by the shell."""
  # Rather than attempting to enumerate the bad shell characters, just
  # whitelist common OK ones and quote anything else.
  if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg):
    return arg  # No quoting necessary.
  if flavor == 'win':
    return gyp.msvs_emulation.QuoteForRspFile(arg)
  return "'" + arg.replace("'", "'" + '"\'"' + "'")  + "'"
def QuoteShellArgument ( arg , flavor ) : # Rather than attempting to enumerate the bad shell characters, just # whitelist common OK ones and quote anything else. if re . match ( r'^[a-zA-Z0-9_=.\\/-]+$' , arg ) : return arg # No quoting necessary. if flavor == 'win' : return gyp . msvs_emulation . QuoteForRspFile ( arg ) return "'" + arg . replace ( "'" , "'" + '"\'"' + "'" ) + "'"