From d60845303bf877dde69ae2077d695646fc2a4579 Mon Sep 17 00:00:00 2001 From: Andrew Jesaitis Date: Mon, 4 Mar 2013 11:07:29 -0700 Subject: [PATCH] Adds __attrs__ back to Session object --- requests/sessions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/requests/sessions.py b/requests/sessions.py index e5132de1..629b38ae 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -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():