Skip to content
Myr

Adds __attrs__ back to Session object

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrew Jesaitis · committed by Andrew Jesaitis · parent 6a0845c · Browse files · 1 file+5 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:requests/sessions.py+5 added-4 removed
174 unmodified lines
175 >>> s.get('http://httpbin.org/get')176 200177 """178179 __attrs__ = [180 'headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks', 181 'params', 'verify', 'cert', 'prefetch']182183 def __init__(self):184185 #: A case-insensitive dictionary of headers to be sent on each186 #: :class:`Request <Request>` sent from this
271 unmodified lines
458 """Registers a connection adapter to a prefix."""459 self.adapters[prefix] = adapter460461 def __getstate__(self):458 if hasattr(self, '__attrs__'):459 return dict((attr, getattr(self, attr, None)) for attr in self.__attrs__)462 return dict((attr, getattr(self, attr, None)) for attr in self.__attrs__)460 else:461 return {}463464 def __setstate__(self, state):465 for attr, value in state.items():466 setattr(self, attr, value)
6 unmodified lines