Bug 1630426 - mach should log to stderr if not logging to a file, r=rstewart

Differential Revision: https://phabricator.services.mozilla.com/D71107

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Bob Clary 2020-04-15 22:33:43 +00:00
parent ed805470e3
commit 6caaf2e39b

View File

@ -28,9 +28,9 @@ def _wrap_stdstream(fh):
encoding = sys.getdefaultencoding()
encoding = 'utf-8' if encoding in ('ascii', 'charmap') else encoding
if six.PY2:
return codecs.getwriter(encoding)(sys.stdout, errors='replace')
return codecs.getwriter(encoding)(fh, errors='replace')
else:
return codecs.getwriter(encoding)(sys.stdout.buffer,
return codecs.getwriter(encoding)(fh.buffer,
errors='replace')
else:
return fh