From 821e148752c21630b1725f3318e1a53721a65865 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Sun, 7 Dec 2014 13:49:23 -0500 Subject: [PATCH 1/2] 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) From ef8ba6d51b80bd7360655e871bcd6396dce6071c Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Mon, 8 Dec 2014 14:40:55 -0500 Subject: [PATCH 2/2] Add requests 2.5 to testing list in .travis.yml and tox.ini --- .travis.yml | 2 ++ tox.ini | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 703b19b..09eb1ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: - WITH_LIB="requests2.2" - WITH_LIB="requests2.3" - WITH_LIB="requests2.4" + - WITH_LIB="requests2.5" - WITH_LIB="requests1.x" - WITH_LIB="httplib2" - WITH_LIB="boto" @@ -33,6 +34,7 @@ install: - if [ $WITH_LIB = "requests2.2" ] ; then pip install requests==2.2.1; fi - if [ $WITH_LIB = "requests2.3" ] ; then pip install requests==2.3.0; fi - if [ $WITH_LIB = "requests2.4" ] ; then pip install requests==2.4.0; fi +- if [ $WITH_LIB = "requests2.5" ] ; then pip install requests==2.5.0; fi - if [ $WITH_LIB = "httplib2" ] ; then pip install httplib2; fi - if [ $WITH_LIB = "boto" ] ; then pip install boto; fi script: python setup.py test diff --git a/tox.ini b/tox.ini index 66e300b..2389a92 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = {py26,py27,py33,py34,pypy}-{requests24,requests23,requests22,requests1,httplib2,urllib3,boto} +envlist = {py26,py27,py33,py34,pypy}-{requests25,requests24,requests23,requests22,requests1,httplib2,urllib3,boto} [testenv] commands = @@ -16,9 +16,10 @@ deps = pytest-localserver PyYAML requests1: requests==1.2.3 + requests25: requests==2.5.0 requests24: requests==2.4.0 requests23: requests==2.3.0 requests22: requests==2.2.1 httplib2: httplib2 urllib3: urllib3==1.7.1 - boto: boto \ No newline at end of file + boto: boto