Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cast to int before hex formatting to support py 3.5
  • Loading branch information
mheilman committed Jul 30, 2016
1 parent 8d3484d commit b87fa0d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,8 @@ python:
# - "2.6"
- 2.7
- 3.3
- 3.4
- 3.5
install:
# setup.py test (script) fetches all test_require files, thus no pip needed
#- pip install --use-mirrors -r test-requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -73,7 +73,7 @@ Not supported
Requirements
------------

- Python 2.6, 2.7, or 3.3
- Python 2.6, 2.7, 3.3, 3.4, or 3.5
- ply (Python Lex-Yacc) (check requirements.txt)


Expand Down
10 changes: 4 additions & 6 deletions lesscpy/lessc/color.py
Expand Up @@ -36,7 +36,7 @@ def process(self, expression):
v = 0xff
if v < 0:
v = 0
r.append("%02x" % v)
r.append("%02x" % int(v))
return ''.join(r)

def operate(self, left, right, operation):
Expand Down Expand Up @@ -384,14 +384,12 @@ def fmt(self, color):
raise ValueError('Cannot format non-color')

def _rgbatohex_raw(self, rgba):
values = ["%x" % v for v in [0xff
if h > 0xff else
0 if h < 0 else h
for h in rgba]]
values = ["%x" % int(v) for v in
[0xff if h > 0xff else 0 if h < 0 else h for h in rgba]]
return values

def _rgbatohex(self, rgba):
return '#%s' % ''.join(["%02x" % v for v in
return '#%s' % ''.join(["%02x" % int(v) for v in
[0xff
if h > 0xff else
0 if h < 0 else h
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -53,6 +53,7 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Pre-processors',
],
Expand Down

0 comments on commit b87fa0d

Please sign in to comment.