Merge ~cjwatson/launchpad:py3-testopenid-testing-helpers into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: ac338299ea88d1a4d2c303d81361b0ffa84ffd22
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-testopenid-testing-helpers
Merge into: launchpad:master
Diff against target: 35 lines (+6/-4)
1 file modified
lib/lp/testopenid/testing/helpers.py (+6/-4)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+391440@code.launchpad.net

Commit message

Port lp.testopenid.testing.helpers to 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/testopenid/testing/helpers.py b/lib/lp/testopenid/testing/helpers.py
2index 99cd52d..fd92520 100644
3--- a/lib/lp/testopenid/testing/helpers.py
4+++ b/lib/lp/testopenid/testing/helpers.py
5@@ -3,6 +3,8 @@
6
7 """Helpers for TestOpenID page tests."""
8
9+from __future__ import absolute_import, print_function
10+
11 __metaclass__ = type
12 __all__ = [
13 'complete_from_browser',
14@@ -11,7 +13,7 @@ __all__ = [
15 'ZopeFetcher',
16 ]
17
18-from StringIO import StringIO
19+import io
20
21 from openid import fetchers
22 from openid.consumer.discover import (
23@@ -30,11 +32,11 @@ class EchoView(LaunchpadView):
24 """A view which just echoes its form arguments in the response."""
25
26 def render(self):
27- out = StringIO()
28- print >> out, 'Request method: %s' % self.request.method
29+ out = io.StringIO()
30+ print(u'Request method: %s' % self.request.method, file=out)
31 keys = sorted(self.request.form.keys())
32 for key in keys:
33- print >> out, '%s:%s' % (key, self.request.form[key])
34+ print(u'%s:%s' % (key, self.request.form[key]), file=out)
35 return out.getvalue()
36
37

Subscribers

People subscribed via source and target branches

to status/vote changes: