Merge lp:~fullermd/brz/fix-2.7-with-future into lp:brz

Proposed by Matthew Fuller on 2019-03-24
Status: Merged
Approved by: Jelmer Vernooij on 2019-03-24
Approved revision: 7296
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~fullermd/brz/fix-2.7-with-future
Merge into: lp:brz
Diff against target: 18 lines (+5/-2)
1 file modified
breezy/tests/test_http_response.py (+5/-2)
To merge this branch: bzr merge lp:~fullermd/brz/fix-2.7-with-future
Reviewer Review Type Date Requested Status
Jelmer Vernooij 2019-03-24 Approve on 2019-03-24
Review via email: mp+365007@code.launchpad.net

Commit message

Fix importing on python2.7 with future.

To post a comment you must log in.
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/test_http_response.py'
2--- breezy/tests/test_http_response.py 2018-11-11 04:08:32 +0000
3+++ breezy/tests/test_http_response.py 2019-03-24 21:04:18 +0000
4@@ -39,9 +39,12 @@
5
6 try:
7 import http.client as http_client
8+except ImportError: # python < 3 without future
9+ import httplib as http_client
10+
11+try:
12 parse_headers = http_client.parse_headers
13-except ImportError: # python < 3
14- import httplib as http_client
15+except AttributeError: # python 2
16 parse_headers = http_client.HTTPMessage
17
18 from .. import (

Subscribers

People subscribed via source and target branches