summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerman M. Bravo <german.mb@deipi.com>2014-09-19 09:47:54 -0500
committerGerman M. Bravo <german.mb@deipi.com>2014-09-19 09:47:54 -0500
commitec6951a02b39a89133aff48ff39b9b3f27d50f8b (patch)
treef95afd088f50b9ac5d2bbbe047b5a9a5a3b68009
parentbe4020d99e4dae164be6366d3e4c9070ea7446fe (diff)
downloadpyscss-ec6951a02b39a89133aff48ff39b9b3f27d50f8b.tar.gz
Normalize make_filename_hash() to remove any path within scss (for tests to be consistent)
-rw-r--r--scss/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scss/util.py b/scss/util.py
index 88dd859..c229438 100644
--- a/scss/util.py
+++ b/scss/util.py
@@ -14,6 +14,8 @@ import six
from scss import config
+BASE_DIR = os.path.dirname(__file__)
+
def split_params(params):
params = params.split(',') or []
@@ -107,7 +109,7 @@ def make_filename_hash(key):
"""Convert the given key (a simple Python object) to a unique-ish hash
suitable for a filename.
"""
- key_repr = repr(key).encode('utf8')
+ key_repr = repr(key).replace(BASE_DIR, '').encode('utf8')
# This is really stupid but necessary for making the repr()s be the same on
# 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