Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

Spits out huge traceback when I use linear-gradient. #174

Closed ssbr closed 11 years ago

ssbr commented 11 years ago

Using scss 1.1.5, Debian Sid.

Note that the input is valid CSS3. So is the output. I don't really get it.

>>> from scss import Scss
>>> import logging
>>> logging.basicConfig()
>>> Scss().compile("""foo {
...     background: linear-gradient(-45deg,
...         transparent 21px,
...         hsl(28, 100%, 50%) 21px);
... }""")
ERROR:scss:Exception raised: 'NumberValue' object is not iterable in `linear-gradient(-45deg,
transparent 21px,
hsl(28, 100%, 50%) 21px)' (<string 'foo {\n    background: linear-gradient(-45deg,\n    ...'>:2)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5533, in eval_expr
    results = P.goal(rule)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5288, in goal
    expr_lst = self.expr_lst(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5456, in expr_lst
    expr_slst = self.expr_slst(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5473, in expr_slst
    expr = self.expr(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5294, in expr
    and_test = self.and_test(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5303, in and_test
    not_test = self.not_test(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5314, in not_test
    comparison = self.comparison(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5332, in comparison
    a_expr = self.a_expr(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5363, in a_expr
    m_expr = self.m_expr(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5378, in m_expr
    u_expr = self.u_expr(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5403, in u_expr
    atom = self.atom(R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5428, in atom
    return call(FNCT, v, R)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 5013, in call
    node = fn(*_args, **_kwargs)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 2594, in _linear_gradient
    _position(position_and_angle) if position_and_angle is not None else None,
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 3586, in _position
    return __position(False, p)
File "/usr/lib/python2.7/dist-packages/scss/__init__.py", line 3555, in __position
    nums = [v for v in p if isinstance(v, NumberValue)]
TypeError: 'NumberValue' object is not iterable
'foo{background:linear-gradient(-45deg,\ntransparent 21px,\nhsl(28, 100%, 50%) 21px)}'
eevee commented 11 years ago

There's a linear-gradient function in Compass (built into pyscss) that mucks with the arguments and sometimes doesn't work quite right.

This case, at least, seems to be handled correctly now.

eevee commented 11 years ago

pyScss 1.2 has been released and should fix this.