summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerman M. Bravo <german.mb@deipi.com>2014-05-22 13:32:08 -0500
committerGerman M. Bravo <german.mb@deipi.com>2014-05-22 13:32:18 -0500
commitabc4a136663aa97538b7c83c65b4e22f3a6045d9 (patch)
tree7b9544368ba5800551fc93dcba7b68787dd22ba9
parent515e6c8910da26054daf038e227f891bc31b2c06 (diff)
downloadpyscss-abc4a136663aa97538b7c83c65b4e22f3a6045d9.tar.gz
Configurations have strings (use unicode literals)
-rw-r--r--scss/__init__.py6
-rw-r--r--scss/config.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/scss/__init__.py b/scss/__init__.py
index d014e20..1a4c749 100644
--- a/scss/__init__.py
+++ b/scss/__init__.py
@@ -85,6 +85,8 @@ except ImportError:
################################################################################
+_default_rule_re = re.compile(r'(?i)\s+!default\Z')
+_xcss_extends_re = re.compile(r'\s+extends\s+')
_safe_strings = {
'^doubleslash^': '//',
@@ -487,7 +489,7 @@ class Scss(object):
from scss.selector import Selector
- parts = re.split(r'\s+extends\s+', raw_selectors, 1)
+ parts = _xcss_extends_re.split(raw_selectors, 1) # handle old xCSS extends
if len(parts) > 1:
unparsed_selectors, unsplit_parents = parts
# Multiple `extends` are delimited by `&`
@@ -1259,7 +1261,7 @@ class Scss(object):
if raw_value is not None:
raw_value = raw_value.strip()
if prop.startswith('$'):
- raw_value, subs = re.subn(r'(?i)\s+!default\Z', '', raw_value)
+ raw_value, subs = _default_rule_re.subn('', raw_value) # handle !default
if subs:
is_default = True
diff --git a/scss/config.py b/scss/config.py
index 7836b65..1c500b9 100644
--- a/scss/config.py
+++ b/scss/config.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
################################################################################
# Configuration:
DEBUG = False