Merge ~cjwatson/launchpad:py3-fix-doctest-output into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 0bb3f635dc3d1cba179fe09f3a2242af66e785af
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-fix-doctest-output
Merge into: launchpad:master
Diff against target: 12 lines (+1/-1)
1 file modified
lib/lp/scripts/utilities/test.py (+1/-1)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+391087@code.launchpad.net

Commit message

Adjust fix_doctest_output to coerce to str, not bytes

Description of the change

doctest._SpoofOut writes to a StringIO.StringIO on Python 2, but an io.StringIO on Python 3.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/scripts/utilities/test.py b/lib/lp/scripts/utilities/test.py
2index 167d5c4..e1e67b8 100755
3--- a/lib/lp/scripts/utilities/test.py
4+++ b/lib/lp/scripts/utilities/test.py
5@@ -44,7 +44,7 @@ def fix_doctest_output():
6 class _SpoofOut(doctest._SpoofOut):
7
8 def write(self, value):
9- _RealSpoofOut.write(self, six.ensure_binary(value))
10+ _RealSpoofOut.write(self, six.ensure_str(value))
11
12 doctest._SpoofOut = _SpoofOut
13

Subscribers

People subscribed via source and target branches

to status/vote changes: