diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-08-31 19:02:48 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-08-31 19:02:48 -0700 |
commit | 66caf45e0b152c14bcec5a24e5a31ca75fe4ea73 (patch) | |
tree | 41b408e3b7a8954aa8635d85a20c29768704b389 /scss/compiler.py | |
parent | 998b20062992292fb8be0c235aacf5f5c303e8a9 (diff) | |
download | pyscss-66caf45e0b152c14bcec5a24e5a31ca75fe4ea73.tar.gz |
Preserve the order of slurpy kwargs. Fix a heisentest.
Diffstat (limited to 'scss/compiler.py')
-rw-r--r-- | scss/compiler.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scss/compiler.py b/scss/compiler.py index c941e2c..6304a3c 100644 --- a/scss/compiler.py +++ b/scss/compiler.py @@ -13,6 +13,12 @@ import re import sys import warnings +try: + from collections import OrderedDict +except ImportError: + # Backport + from ordereddict import OrderedDict + import six import scss.config as config @@ -574,7 +580,7 @@ class Compilation(object): def _populate_namespace_from_call(self, name, callee_namespace, mixin, args, kwargs): # Mutation protection args = list(args) - kwargs = dict(kwargs) + kwargs = OrderedDict(kwargs) #m_params = mixin[0] #m_defaults = mixin[1] @@ -665,7 +671,7 @@ class Compilation(object): # TODO CallOp converts Sass names to Python names, so we # have to convert them back to Sass names. would be nice # to avoid this back-and-forth somehow - kwargs = dict( + kwargs = OrderedDict( (normalize_var('$' + key), value) for (key, value) in kwargs.items()) |