diff options
author | German M. Bravo <german.mb@deipi.com> | 2014-09-19 09:47:54 -0500 |
---|---|---|
committer | German M. Bravo <german.mb@deipi.com> | 2014-09-19 09:47:54 -0500 |
commit | ec6951a02b39a89133aff48ff39b9b3f27d50f8b (patch) | |
tree | f95afd088f50b9ac5d2bbbe047b5a9a5a3b68009 | |
parent | be4020d99e4dae164be6366d3e4c9070ea7446fe (diff) | |
download | pyscss-ec6951a02b39a89133aff48ff39b9b3f27d50f8b.tar.gz |
Normalize make_filename_hash() to remove any path within scss (for tests to be consistent)
-rw-r--r-- | scss/util.py | 4 |
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 |