#NEWLINE# def run_alias( alias , args ) : #NEWLINE# #INDENT# 'Run the alias with the given arguments, after expanding parameters.\n\n    Parameter expansion is done by the replace_arguments function.\n    ' #NEWLINE# ( cmd , use_shell ) = expand_alias ( alias , args ) #NEWLINE# try : #NEWLINE# #INDENT# if use_shell : #NEWLINE# #INDENT# cmd = subprocess . list2cmdline ( alias ) #NEWLINE# #UNINDENT# return subprocess . call ( cmd , shell = use_shell ) #NEWLINE# #UNINDENT# except ValueError as e : #NEWLINE# #INDENT# logging . error ( 'Could not execute alias "%s"; it was malformed: %s' , alias , e ) #NEWLINE# #UNINDENT# return 1