mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Adds __attrs__ back to Session object
This commit is contained in:
@@ -176,6 +176,10 @@ class Session(SessionRedirectMixin):
|
||||
200
|
||||
"""
|
||||
|
||||
__attrs__ = [
|
||||
'headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks',
|
||||
'params', 'verify', 'cert', 'prefetch']
|
||||
|
||||
def __init__(self):
|
||||
|
||||
#: A case-insensitive dictionary of headers to be sent on each
|
||||
@@ -455,10 +459,7 @@ class Session(SessionRedirectMixin):
|
||||
self.adapters[prefix] = adapter
|
||||
|
||||
def __getstate__(self):
|
||||
if hasattr(self, '__attrs__'):
|
||||
return dict((attr, getattr(self, attr, None)) for attr in self.__attrs__)
|
||||
else:
|
||||
return {}
|
||||
return dict((attr, getattr(self, attr, None)) for attr in self.__attrs__)
|
||||
|
||||
def __setstate__(self, state):
|
||||
for attr, value in state.items():
|
||||
|
||||
Reference in New Issue
Block a user