1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Merge pull request #2217 from dstufft/upgrade-cachecontrol

Upgrade CacheControl to 0.10.7
This commit is contained in:
Donald Stufft 2014-12-17 23:37:09 -05:00
commit e4d12f96af
5 changed files with 16 additions and 4 deletions

View file

@ -104,3 +104,7 @@ class CacheControlAdapter(HTTPAdapter):
resp.from_cache = from_cache
return resp
def close(self):
self.cache.close()
super(CacheControlAdapter, self).close()

View file

@ -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):

View file

@ -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

View file

@ -36,3 +36,6 @@ class RedisCache(object):
caution!"""
for key in self.conn.keys():
self.conn.delete(key)
def close(self):
self.conn.disconnect()

View file

@ -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