Skip to content

Commit 36e0e6c

Browse files
author
Andrey Fedoseev
committed
Fix error handling in libsass compiler for Python 3
1 parent e1547f1 commit 36e0e6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

static_precompiler/compilers/libsass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def compile_file(self, source_path):
5050
else:
5151
compiled = sass.compile(filename=full_source_path, include_paths=self.load_paths)
5252
except sass.CompileError as e:
53-
raise exceptions.StaticCompilationError(e.message)
53+
raise exceptions.StaticCompilationError(encoding.force_str(e))
5454

5555
compiled = encoding.force_str(compiled)
5656
sourcemap = encoding.force_str(sourcemap)
@@ -72,7 +72,7 @@ def compile_source(self, source):
7272
try:
7373
compiled = sass.compile(string=source, indented=self.indented)
7474
except sass.CompileError as e:
75-
raise exceptions.StaticCompilationError(e.message)
75+
raise exceptions.StaticCompilationError(encoding.force_str(e))
7676

7777
compiled = encoding.force_str(compiled)
7878

0 commit comments

Comments
 (0)