summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-08-25 16:00:54 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-08-25 16:01:15 (GMT)
commite7d34ce0828ecad4bbe8310d1e54e39b406376b9 (patch)
tree86b15fdf187ef52ec9a48f3270794af478e6b791
parentb351f2e8aa1021151bcd750674e72ed5d2d7e203 (diff)
downloadmisc-fred-master.zip
misc-fred-master.tar.gz
misc-fred-master.tar.bz2
sassw: let subprocess.run handle text encodingHEADmaster
-rwxr-xr-xbin/sassw9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/sassw b/bin/sassw
index ca35bff..05dc4b4 100755
--- a/bin/sassw
+++ b/bin/sassw
@@ -25,9 +25,10 @@ def build():
global sources, directories
result = subprocess.run(
['sassc', '-mauto', filename, filename.replace('.scss', '.css')],
- capture_output=True)
- sys.stdout.write(result.stdout.decode('utf-8'))
- sys.stderr.write(result.stderr.decode('utf-8'))
+ capture_output=True,
+ text=True)
+ sys.stdout.write(result.stdout)
+ sys.stderr.write(result.stderr)
if result.returncode:
# error
with open(filename.replace('.scss', '.css'), 'w') as fd:
@@ -35,7 +36,7 @@ def build():
white-space: pre;
font-family: monospace;
content: "%s";
- }''' % result.stderr.decode('utf-8').replace('\n', '\\A').replace('"', '\\"'),
+ }''' % result.stderr.replace('\n', '\\A').replace('"', '\\"'),
file=fd)
basepath = os.path.abspath(os.path.dirname(filename))
sources = [os.path.abspath(os.path.join(basepath, x)) for x in json.load(open(filename.replace('.scss', '.css.map')))['sources']]