Move comment to the right place
authorIan Cordasco <graffatcolmingov@gmail.com>
Sat, 14 Dec 2013 04:29:30 +0000 (22:29 -0600)
committerIan Cordasco <graffatcolmingov@gmail.com>
Sat, 14 Dec 2013 04:29:30 +0000 (22:29 -0600)
requests/adapters.py

index 5bb7b0c15aa530554895793685bd69b65ee94a93..e079c43685e35bf0911fb826dbf58703a2a4d25f 100644 (file)
@@ -88,6 +88,8 @@ class HTTPAdapter(BaseAdapter):
                     self.__attrs__)
 
     def __setstate__(self, state):
+        # Can't handle by adding 'proxy_manager' to self.__attrs__ because
+        # because self.poolmanager uses a lambda function, which isn't pickleable.
         self.proxy_manager = {}
         self.config = {}
 
@@ -97,11 +99,6 @@ class HTTPAdapter(BaseAdapter):
         self.init_poolmanager(self._pool_connections, self._pool_maxsize,
                               block=self._pool_block)
 
-        # Can't handle by adding 'proxy_manager' to self.__attrs__ because
-        # because self.poolmanager uses a lambda function, which isn't pickleable.
-        if not hasattr(self, 'proxy_manager'):
-            self.proxy_manager = {}
-
     def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK):
         """Initializes a urllib3 PoolManager. This method should not be called
         from user code, and is only exposed for use when subclassing the