From c517f87a2c536f6ebd3773b869430572ba3eb811 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 4 Aug 2014 10:18:49 +0200 Subject: [PATCH] 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. --- django_pyscss/scss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):