summaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
Diffstat (limited to 'yarn')
-rwxr-xr-xyarn13
1 files changed, 9 insertions, 4 deletions
diff --git a/yarn b/yarn
index f1cabb3..2e336b0 100755
--- a/yarn
+++ b/yarn
@@ -19,6 +19,7 @@
import cliapp
import collections
+import locale
import logging
import os
import re
@@ -106,12 +107,16 @@ class YarnRunner(cliapp.Application):
default=False)
def stdout(self, msg):
- self.output.write(msg)
- self.output.flush()
+ self._write(sys.stdout, msg)
def stderr(self, msg):
- sys.stderr.write(msg)
- sys.stderr.flush()
+ self._write(sys.stderr, msg)
+
+ def _write(self, output, msg):
+ if isinstance(msg, unicode):
+ msg = msg.encode(locale.getpreferredencoding())
+ output.write(msg)
+ output.flush()
def info(self, indent, msg):
if self.settings['verbose']: