Skip to content

Commit

Permalink
Remove CookieJar FakeHttpResponse compat
Browse files Browse the repository at this point in the history
We shouldn't need this any more as we can rely on python3
  • Loading branch information
jamielennox committed Jan 22, 2024
1 parent c74eb15 commit e3bd0d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
30 changes: 0 additions & 30 deletions requests_mock/compat.py

This file was deleted.

4 changes: 1 addition & 3 deletions requests_mock/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from requests.packages.urllib3.response import HTTPResponse
from requests.utils import get_encoding_from_headers

from requests_mock import compat
from requests_mock import exceptions

_BODY_ARGS = frozenset(['raw', 'body', 'content', 'text', 'json'])
Expand Down Expand Up @@ -101,8 +100,7 @@ def _extract_cookies(request, response, cookies):
"""
# This will add cookies set manually via the Set-Cookie or Set-Cookie2
# header but this only allows 1 cookie to be set.
http_message = compat._FakeHTTPMessage(response.headers)
response.cookies.extract_cookies(MockResponse(http_message),
response.cookies.extract_cookies(MockResponse(response.raw.headers),
MockRequest(request))

# This allows you to pass either a CookieJar or a dictionary to request_uri
Expand Down

0 comments on commit e3bd0d1

Please sign in to comment.