]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Fix crash with requests 2.5 where connectionpool was None
authorChase Sterling <chase.sterling@gmail.com>
Sun, 7 Dec 2014 18:49:23 +0000 (13:49 -0500)
committerChase Sterling <chase.sterling@gmail.com>
Sun, 7 Dec 2014 18:49:23 +0000 (13:49 -0500)
vcr/patch.py

index aeabf1d9e4474cdd4ac9fb9dd0e7e16c5fd65813..6cce450b4b2bb8fb7ede7543204ee1ae881b46ab 100644 (file)
@@ -236,7 +236,7 @@ class ConnectionRemover(object):
     def __exit__(self, *args):
         for pool, connections in self._connection_pool_to_connections.items():
             readd_connections = []
-            while not pool.pool.empty() and connections:
+            while pool.pool and not pool.pool.empty() and connections:
                 connection = pool.pool.get()
                 if isinstance(connection, self._connection_class):
                     connections.remove(connection)