Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Fix broken invert function #25

Merged
merged 1 commit into from
Dec 19, 2011
Merged

Fix broken invert function #25

merged 1 commit into from
Dec 19, 2011

Conversation

quinox
Copy link

@quinox quinox commented Dec 18, 2011

The invert-function in trunk is broken because it tries to assign to a tuple:

(scss)quinox@tikko ~/tmp/scss $ echo 'invert(#567)' | scss
Traceback (most recent call last):
  File "/home/quinox/tmp/scss/bin/scss", line 8, in <module>
    load_entry_point('scss==0.8.71', 'console_scripts', 'scss')()
  File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/tool.py", line 185, in main
    outfile.write(s.load(infile))
  File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/parser.py", line 353, in load
    return ''.join(map(str, nodes))
  File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/value.py", line 100, in __str__
    return str(self.value)
  File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/control.py", line 66, in value
    first = first.value
  File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/control.py", line 88, in value
    return func(*params, **kwargs)
  File "/home/quinox/tmp/scss/lib/python2.7/site-packages/scss/function.py", line 268, in _invert
    c[0] = 255.0 - c[0]
TypeError: 'tuple' object does not support item assignment

I fixed it by creating a new ColorValue object instead. I've added a few testcases for the invert-function and one for the adjust-lightness function as well.

klen added a commit that referenced this pull request Dec 19, 2011
Fix broken invert function
@klen klen merged commit 8280497 into klen:master Dec 19, 2011
@klen
Copy link
Owner

klen commented Dec 19, 2011

Thanks. Done in version 0.8.72

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants