diff --git a/.travis.yml b/.travis.yml index 6c84fed..84f25ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: python python: - "2.6" - "2.7" - #- "3.3" + - "3.3" # command to install dependencies install: "pip install -r requirements.txt --use-mirrors" # command to run tests diff --git a/lesscpy/lessc/color.py b/lesscpy/lessc/color.py index f10683e..c0da7fa 100644 --- a/lesscpy/lessc/color.py +++ b/lesscpy/lessc/color.py @@ -62,7 +62,7 @@ class Color(): return self.rgba(*args) elif len(args) == 3: try: - return self._rgbatohex(map(int, args)) + return self._rgbatohex(list(map(int, args))) except ValueError: if all((a for a in args if a[-1] == '%' @@ -80,7 +80,7 @@ class Color(): """ if len(args) == 4: try: - return self._rgbatohex(map(int, args)) + return self._rgbatohex(list(map(int, args))) except ValueError: if all((a for a in args if a[-1] == '%' diff --git a/lesscpy/lessc/lexer.py b/lesscpy/lessc/lexer.py index 662f776..e03d86a 100644 --- a/lesscpy/lessc/lexer.py +++ b/lesscpy/lessc/lexer.py @@ -84,7 +84,7 @@ class LessLexer: def __init__(self): self.build(reflags=re.UNICODE | re.IGNORECASE) self.last = None - self.next = None + self.next_ = None self.pretok = True def t_css_filter(self, t): @@ -256,9 +256,9 @@ class LessLexer: 2. Strips out whitespace from nonsignificant locations to ease parsing. """ - if self.next: - t = self.next - self.next = None + if self.next_: + t = self.next_ + self.next_ = None return t while True: t = self.lexer.token() @@ -270,7 +270,7 @@ class LessLexer: continue self.pretok = False if t.type == '}' and self.last and self.last.type not in '{;}': - self.next = t + self.next_ = t tok = lex.LexToken() tok.type = ';' tok.value = ';' diff --git a/lesscpy/lessc/parser.py b/lesscpy/lessc/parser.py index a744679..d45c15f 100644 --- a/lesscpy/lessc/parser.py +++ b/lesscpy/lessc/parser.py @@ -1,4 +1,3 @@ -from __future__ import print_function # -*- coding: utf8 -*- """ .. module:: lesscpy.lessc.parser @@ -12,9 +11,13 @@ from __future__ import print_function See LICENSE for details. .. moduleauthor:: Johann T. Mariusson """ + +from __future__ import print_function + import os import sys import ply.yacc + from . import lexer from . import utility from .scope import Scope diff --git a/lesscpy/lessc/utility.py b/lesscpy/lessc/utility.py index b74cb7f..33977a4 100644 --- a/lesscpy/lessc/utility.py +++ b/lesscpy/lessc/utility.py @@ -7,6 +7,9 @@ See LICENSE for details. .. moduleauthor:: Johann T. Mariusson """ + +from __future__ import print_function + import collections import re diff --git a/lesscpy/plib/mixin.py b/lesscpy/plib/mixin.py index aec9d73..75ead7e 100644 --- a/lesscpy/plib/mixin.py +++ b/lesscpy/plib/mixin.py @@ -56,7 +56,7 @@ class Mixin(Node): raises: SyntaxError """ - arguments = zip(args, [' '] * len(args)) if args and args[0] else None + arguments = list(zip(args, [' '] * len(args))) if args and args[0] else None zl = itertools.zip_longest if sys.version_info[ 0] == 3 else itertools.izip_longest if self.args: diff --git a/lesscpy/scripts/compiler.py b/lesscpy/scripts/compiler.py index d3db996..f6b92c7 100644 --- a/lesscpy/scripts/compiler.py +++ b/lesscpy/scripts/compiler.py @@ -1,4 +1,3 @@ -from __future__ import print_function # -*- coding: utf8 -*- """ .. module:: lesscpy.scripts.compiler @@ -10,11 +9,15 @@ from __future__ import print_function See LICENSE for details .. moduleauthor:: Johann T. Mariusson """ + +from __future__ import print_function + import os import sys import glob import copy import argparse + sys.path.append(os.path.abspath(os.path.dirname(__file__))) from lesscpy.lessc import parser from lesscpy.lessc import lexer diff --git a/tox.ini b/tox.ini index 1d001e0..e1744d8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,pep8 +envlist = py26,py27,py33,pep8 [testenv] deps = -r{toxinidir}/requirements.txt