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

Fix crash with requests 2.5 where connectionpool was None

This commit is contained in:
Chase Sterling
2014-12-07 13:49:23 -05:00
parent 7306205b8a
commit 821e148752

View 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)