Commit 29154185 authored by adam j hartz's avatar adam j hartz

allow generators and bare tuples in @(...)

parent 113e655f
......@@ -16,4 +16,4 @@
# xonsh is Copyright (c) 2015-2016 the xonsh developers and is licensed under
# the 2-Clause BSD license.
__version__ = '0.0.18'
__version__ = '0.0.19'
......@@ -621,10 +621,11 @@ def list_of_strs_or_callables(x):
"""Ensures that x is a list of strings or functions"""
if isinstance(x, str) or callable(x):
rtn = [x]
elif isinstance(x, Sequence):
rtn = [i if isinstance(i, str) or callable(i) else str(i) for i in x]
else:
rtn = [str(x)]
try:
rtn = [i if isinstance(i, str) or callable(i) else str(i) for i in x]
except TypeError:
rtn = [str(x)]
return rtn
......
......@@ -2221,7 +2221,7 @@ class BaseParser(object):
p[0] = p0
def p_subproc_atom_pyeval(self, p):
"""subproc_atom : AT_LPAREN test RPAREN"""
"""subproc_atom : AT_LPAREN testlist_comp RPAREN"""
p0 = tako_call('__tako_list_of_strs_or_callables__', [p[2]],
lineno=self.lineno, col=self.col)
p0._cliarg_action = 'extend'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment