summaryrefslogtreecommitdiff
path: root/scss/compiler.py
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2014-09-08 17:55:02 -0700
committerEevee (Alex Munroe) <eevee.git@veekun.com>2014-09-08 17:55:02 -0700
commitbbe1908512f3cc6de4f2af77f47a7da0cf06d938 (patch)
tree1fbc7f698e00ca6956654f15ea2e2f0266cab676 /scss/compiler.py
parentfbc1a4ec682cf6f67541db8700b86a896d92c2a8 (diff)
downloadpyscss-bbe1908512f3cc6de4f2af77f47a7da0cf06d938.tar.gz
Double fix for @import breaking when given a relative dirname.
Diffstat (limited to 'scss/compiler.py')
-rw-r--r--scss/compiler.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/scss/compiler.py b/scss/compiler.py
index fb6e8a9..5ecd7f3 100644
--- a/scss/compiler.py
+++ b/scss/compiler.py
@@ -851,9 +851,11 @@ class Compilation(object):
source = SourceFile.from_string(generated_code)
else:
- if path not in self.source_index:
- self.add_source(SourceFile.from_filename(path))
- source = self.source_index[path]
+ if path in self.source_index:
+ source = self.source_index[path]
+ else:
+ source = SourceFile.from_filename(path)
+ self.add_source(source)
if rule.namespace.has_import(source):
# If already imported in this scope, skip
@@ -898,7 +900,9 @@ class Compilation(object):
dirname, basename = os.path.split(name)
# Search relative to the importing file first
- search_path = [os.path.dirname(rule.source_file.path)]
+ search_path = [
+ os.path.normpath(os.path.abspath(
+ os.path.dirname(rule.source_file.path)))]
search_path.extend(self.compiler.search_path)
for prefix, suffix in product(('_', ''), search_exts):