diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-10-31 12:02:49 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-10-31 12:02:49 -0400 |
commit | 4c19e2aee48069568020d4e923ba85a4ea599d15 (patch) | |
tree | 57a8d3e73ef0174524bbf8fde4fbc86ed6667faa /coverage/summary.py | |
parent | e6f0a4e607e1f70315957034db4ac672421ae263 (diff) | |
download | python-coveragepy-git-4c19e2aee48069568020d4e923ba85a4ea599d15.tar.gz |
Try a different strategy for setting and testing output encodings
Diffstat (limited to 'coverage/summary.py')
-rw-r--r-- | coverage/summary.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/coverage/summary.py b/coverage/summary.py index f797e306..5ddbb380 100644 --- a/coverage/summary.py +++ b/coverage/summary.py @@ -8,7 +8,7 @@ import sys from coverage import env from coverage.report import Reporter from coverage.results import Numbers -from coverage.misc import NotPython, CoverageException +from coverage.misc import NotPython, CoverageException, output_encoding class SummaryReporter(Reporter): @@ -52,8 +52,7 @@ class SummaryReporter(Reporter): outfile = sys.stdout if env.PY2: - encoding = getattr(outfile, "encoding", None) or sys.getfilesystemencoding() - writeout = lambda u: outfile.write(u.encode(encoding)) + writeout = lambda u: outfile.write(u.encode(output_encoding())) else: writeout = outfile.write |