summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Khyn <thomas@ksytek.com>2014-06-24 00:10:45 +1200
committerThomas Khyn <thomas@ksytek.com>2014-06-24 00:10:45 +1200
commit37264fe7643dbcd334a53e3ba6e196a7ef626a0a (patch)
treed02daad093e42729656b0fd5828e457c2362fc1b
parent6150388253d82aeb51ef9acb2b7bc018d96be073 (diff)
downloadpyscss-37264fe7643dbcd334a53e3ba6e196a7ef626a0a.tar.gz
Fixed make_filename_hash on windows
--HG-- branch : compat_win
-rw-r--r--scss/util.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/scss/util.py b/scss/util.py
index c84d69a..2a168ad 100644
--- a/scss/util.py
+++ b/scss/util.py
@@ -111,6 +111,9 @@ def make_filename_hash(key):
# Python 2 and 3 and thus allowing the test suite to run on both.
# TODO better solutions include: not using a repr, not embedding hashes in
# the expected test results
+ if sys.platform == 'win32':
+ # this is to make sure the hash is the same on win and unix platforms
+ key_repr = key_repr.replace('\\\\', '/')
key_repr = re.sub(b"\\bu'", b"'", key_repr)
key_hash = hashlib.md5(key_repr).digest()
return base64.b64encode(key_hash, b'__').decode('ascii').rstrip('=')