summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadomir Dopieralski <openstack@sheep.art.pl>2014-08-04 10:18:49 +0200
committerRadomir Dopieralski <openstack@sheep.art.pl>2014-08-04 12:00:30 +0200
commitc517f87a2c536f6ebd3773b869430572ba3eb811 (patch)
tree65f04abf8ac16e9514c0810cac58052d4009a70b
parent56c7db6e2b09f8913da9ee0d8d66cb38c11cdd32 (diff)
downloaddjango-pyscss-c517f87a2c536f6ebd3773b869430572ba3eb811.tar.gz
Put the original path at the end in get_possible_paths
Make it try all the combinations of prefixes and suffixes first, and then try the original path. This way if there is a directory named the same as our file, but without the extension and/or prefix, we don't try to open it and avoid raising IOError. Fixes #10.
-rw-r--r--django_pyscss/scss.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django_pyscss/scss.py b/django_pyscss/scss.py
index 7429eba..b4c5981 100644
--- a/django_pyscss/scss.py
+++ b/django_pyscss/scss.py
@@ -67,7 +67,6 @@ class DjangoScss(Scss):
path = path[1:]
elif relative_to: # relative import
path = os.path.join(relative_to, path)
- paths.append(path)
dirname, filename = os.path.split(path)
name, ext = os.path.splitext(filename)
@@ -77,6 +76,7 @@ class DjangoScss(Scss):
search_exts = self.supported_extensions
for prefix, suffix in product(('_', ''), search_exts):
paths.append(os.path.join(dirname, prefix + name + suffix))
+ paths.append(path)
return paths
def _find_source_file(self, filename, relative_to=None):