diff options
author | German M. Bravo <german.mb@deipi.com> | 2013-05-06 10:10:19 -0500 |
---|---|---|
committer | German M. Bravo <german.mb@deipi.com> | 2013-05-06 10:10:19 -0500 |
commit | d01e36a189d183b3384824cb1dbd046bbc0ba532 (patch) | |
tree | 1271ef68ca6e923146ad78eb7b7f380a1cecf030 | |
parent | b78b8ee6ea21bf480b450f5a42087b7bece7edd8 (diff) | |
download | pyscss-d01e36a189d183b3384824cb1dbd046bbc0ba532.tar.gz |
Fix so the regexp works using StringValue's value
-rw-r--r-- | scss/__init__.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scss/__init__.py b/scss/__init__.py index d274431..a9cac83 100644 --- a/scss/__init__.py +++ b/scss/__init__.py @@ -1409,12 +1409,12 @@ class Scss(object): val = True if val: val = self.calculate(name, rule[CONTEXT], rule[OPTIONS], rule) - if isinstance(val, basestring): - if val != 'false' and not _undefined_re.match(val): + if isinstance(val, (basestring, StringValue)): + if val != 'false' and not _undefined_re.match(unicode(val)): val = True else: val = False - elif isinstance(val, (BooleanValue, bool)): + elif isinstance(val, (bool, BooleanValue)): val = bool(val) else: val = True @@ -3691,7 +3691,7 @@ def _compact(*args): if isinstance(args, dict): for i, item in args.items(): if isinstance(item, (basestring, StringValue)): - if item != 'false' and not _undefined_re.match(item): + if item != 'false' and not _undefined_re.match(unicode(item)): ret[i] = item elif isinstance(item, (bool, BooleanValue)): if bool(item): @@ -3699,7 +3699,7 @@ def _compact(*args): else: ret[i] = item elif isinstance(args, (basestring, StringValue)): - if args != 'false' and not _undefined_re.match(args): + if args != 'false' and not _undefined_re.match(unicode(args)): ret[0] = args elif isinstance(args, (bool, BooleanValue)): if bool(args): @@ -3710,7 +3710,7 @@ def _compact(*args): ret['_'] = ',' for i, item in enumerate(args): if isinstance(item, (basestring, StringValue)): - if item != 'false' and not _undefined_re.match(item): + if item != 'false' and not _undefined_re.match(unicode(item)): ret[i] = item elif isinstance(item, (bool, BooleanValue)): if bool(item): |