From 821e148752c21630b1725f3318e1a53721a65865 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Sun, 7 Dec 2014 13:49:23 -0500 Subject: [PATCH] Fix crash with requests 2.5 where connectionpool was None --- vcr/patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcr/patch.py b/vcr/patch.py index aeabf1d..6cce450 100644 --- a/vcr/patch.py +++ b/vcr/patch.py @@ -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)