From c5edfde9cee694608f4fa05578005b96d017f0b3 Mon Sep 17 00:00:00 2001 From: Donald Stufft Date: Wed, 17 Dec 2014 21:45:01 -0500 Subject: [PATCH] Upgrade CacheControl to 0.10.7 --- pip/_vendor/cachecontrol/adapter.py | 4 ++++ pip/_vendor/cachecontrol/cache.py | 7 +++++-- pip/_vendor/cachecontrol/caches/file_cache.py | 4 +++- pip/_vendor/cachecontrol/caches/redis_cache.py | 3 +++ pip/_vendor/vendor.txt | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pip/_vendor/cachecontrol/adapter.py b/pip/_vendor/cachecontrol/adapter.py index c41f7e1ef..6d0c16083 100644 --- a/pip/_vendor/cachecontrol/adapter.py +++ b/pip/_vendor/cachecontrol/adapter.py @@ -104,3 +104,7 @@ class CacheControlAdapter(HTTPAdapter): resp.from_cache = from_cache return resp + + def close(self): + self.cache.close() + super(CacheControlAdapter, self).close() diff --git a/pip/_vendor/cachecontrol/cache.py b/pip/_vendor/cachecontrol/cache.py index feb7d3ed8..7389a73f8 100644 --- a/pip/_vendor/cachecontrol/cache.py +++ b/pip/_vendor/cachecontrol/cache.py @@ -1,6 +1,6 @@ """ -The cache object API for implementing caches. The default is just a -dictionary, which in turns means it is not threadsafe for writing. +The cache object API for implementing caches. The default is a thread +safe in-memory dictionary. """ from threading import Lock @@ -16,6 +16,9 @@ class BaseCache(object): def delete(self, key): raise NotImplemented() + def close(self): + pass + class DictCache(BaseCache): diff --git a/pip/_vendor/cachecontrol/caches/file_cache.py b/pip/_vendor/cachecontrol/caches/file_cache.py index 8959a59b6..eeee1a369 100644 --- a/pip/_vendor/cachecontrol/caches/file_cache.py +++ b/pip/_vendor/cachecontrol/caches/file_cache.py @@ -3,6 +3,8 @@ import os from pip._vendor.lockfile import FileLock +from ..cache import BaseCache + def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode @@ -44,7 +46,7 @@ def _secure_open_write(filename, fmode): raise -class FileCache(object): +class FileCache(BaseCache): def __init__(self, directory, forever=False, filemode=0o0600, dirmode=0o0700): self.directory = directory diff --git a/pip/_vendor/cachecontrol/caches/redis_cache.py b/pip/_vendor/cachecontrol/caches/redis_cache.py index 72b8ca317..9f5d55fd9 100644 --- a/pip/_vendor/cachecontrol/caches/redis_cache.py +++ b/pip/_vendor/cachecontrol/caches/redis_cache.py @@ -36,3 +36,6 @@ class RedisCache(object): caution!""" for key in self.conn.keys(): self.conn.delete(key) + + def close(self): + self.conn.disconnect() diff --git a/pip/_vendor/vendor.txt b/pip/_vendor/vendor.txt index 96619d44d..caeb5c7dd 100644 --- a/pip/_vendor/vendor.txt +++ b/pip/_vendor/vendor.txt @@ -4,7 +4,7 @@ six==1.8.0 colorama==0.3.2 requests==2.5.0 certifi==14.05.14 -CacheControl==0.10.4 +CacheControl==0.10.7 lockfile==0.10.2 progress==1.2 ipaddress==1.0.7 # Only needed on 2.6, 2.7, and 3.2