summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEevee <eevee.github@veekun.com>2016-06-08 18:49:12 -0700
committerEevee <eevee.github@veekun.com>2016-06-08 18:49:12 -0700
commit74ff779133cda5695b67106159e809dabb2899c4 (patch)
tree1a29abf7028ab5d52fa999d47a8ba6684574d70f
parent9ea91782b4b4dacc144454db14c32e9302e9347b (diff)
parenta297f91cf11786178759692c218b630f2fdcd085 (diff)
downloadpyscss-74ff779133cda5695b67106159e809dabb2899c4.tar.gz
Merge pull request #332 from dexbol/narrow-build
Workaround for narrow Python build
-rw-r--r--scss/cssdefs.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scss/cssdefs.py b/scss/cssdefs.py
index 79be7b4..6b4f5b7 100644
--- a/scss/cssdefs.py
+++ b/scss/cssdefs.py
@@ -449,7 +449,11 @@ escape_rx = re.compile(r"(?s)\\([0-9a-fA-F]{1,6})[\n\t ]?|\\(.)|\\\n")
def _unescape_one(match):
if match.group(1) is not None:
- return six.unichr(int(match.group(1), 16))
+ try:
+ return six.unichr(int(match.group(1), 16))
+ except ValueError:
+ return (r'\U%08x' % int(match.group(1), 16)).decode(
+ 'unicode-escape')
elif match.group(2) is not None:
return match.group(2)
else: