/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_http_response.py

  • Committer: Jelmer Vernooij
  • Date: 2020-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
  InvalidHttpResponse.
38
38
"""
39
39
 
40
 
try:
41
 
    import http.client as http_client
42
 
except ImportError:  # python < 3 without future
43
 
    import httplib as http_client
44
 
 
45
 
try:
46
 
    parse_headers = http_client.parse_headers
47
 
except AttributeError:  # python 2
48
 
    parse_headers = http_client.HTTPMessage
 
40
from io import BytesIO
 
41
 
 
42
import http.client as http_client
 
43
 
 
44
parse_headers = http_client.parse_headers
49
45
 
50
46
from .. import (
51
47
    errors,
52
48
    tests,
53
49
    )
54
 
from ..sixish import (
55
 
    BytesIO,
56
 
    PY3,
57
 
    )
58
50
from ..transport.http import (
59
51
    response,
60
52
    HTTPConnection,
730
722
        # Get rid of the status line
731
723
        status_and_headers.readline()
732
724
        msg = parse_headers(status_and_headers)
733
 
        if PY3:
734
 
            return msg.get
735
 
        else:
736
 
            return msg.getheader
 
725
        return msg.get
737
726
 
738
727
    def get_response(self, a_response):
739
728
        """Process a supplied response, and return the result."""