def _expand_args(command):
<EOL>if isinstance(command, STR_TYPES):<EOL><INDENT>if sys.version_info[<NUM_LIT:0>] == <NUM_LIT:2>:<EOL><INDENT>splitter = shlex.shlex(command.encode("<STR_LIT:utf-8>"))<EOL><DEDENT>elif sys.version_info[<NUM_LIT:0>] == <NUM_LIT:3>:<EOL><INDENT>splitter = shlex.shlex(command)<EOL><DEDENT>else:<EOL><INDENT>splitter = shlex.shlex(command.encode("<STR_LIT:utf-8>"))<EOL><DEDENT>splitter.whitespace = "<STR_LIT:|>"<EOL>splitter.whitespace_split = True<EOL>command = []<EOL>while True:<EOL><INDENT>token = splitter.get_token()<EOL>if token:<EOL><INDENT>command.append(token)<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>command = list(map(shlex.split, command))<EOL><DEDENT>return command<EOL>
Parses command strings and returns a Popen-ready list.