summaryrefslogtreecommitdiff
path: root/requests_cache/models
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-07-16 12:24:12 -0500
committerJordan Cook <jordan.cook@pioneer.com>2021-07-16 12:24:12 -0500
commit345247ee63f0e3853e6af79c56f53ac47dd68439 (patch)
tree738f46ed62ddbf12c3180c732d39bbba934bfd8d /requests_cache/models
parent9723ab87b35634e58b73641b7e0b5c22bb6d6ec3 (diff)
downloadrequests-cache-345247ee63f0e3853e6af79c56f53ac47dd68439.tar.gz
Fix unpickling CachedResponse on python 3.6
Diffstat (limited to 'requests_cache/models')
-rwxr-xr-xrequests_cache/models/response.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/requests_cache/models/response.py b/requests_cache/models/response.py
index a0efb72..693e0fa 100755
--- a/requests_cache/models/response.py
+++ b/requests_cache/models/response.py
@@ -111,6 +111,12 @@ class CachedResponse(Response):
"""Get the size of the response body in bytes"""
return len(self.content) if self.content else 0
+ def __getstate__(self):
+ """Override pickling behavior in ``requests.Response.__getstate__``;
+ only required for python 3.6
+ """
+ return self.__dict__
+
def __str__(self):
return (
f'request: {self.request}, response: {self.status_code} '