1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Merge pull request #125 from gazpachoking/pool_is_none

Fix crash with requests 2.5 where connectionpool was None
This commit is contained in:
Ivan 'Goat' Malison
2014-12-08 13:20:36 -08:00
3 changed files with 6 additions and 3 deletions

View File

@@ -237,7 +237,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)