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

Merge pull request #2856 from dstufft/support-falsey-cache-dir

Support a falsey cache-dir
This commit is contained in:
Donald Stufft 2015-06-01 21:26:11 -04:00
commit ae0b4a76ad
2 changed files with 5 additions and 1 deletions

View file

@ -55,7 +55,7 @@ class WheelCache(object):
:param format_control: A pip.index.FormatControl object to limit
binaries being read from the cache.
"""
self._cache_dir = os.path.expanduser(cache_dir)
self._cache_dir = os.path.expanduser(cache_dir) if cache_dir else None
self._format_control = format_control
def cached_wheel(self, link, package_name):

View file

@ -397,3 +397,7 @@ class TestWheelCache:
def test_expands_path(self):
wc = wheel.WheelCache("~/.foo/", None)
assert wc._cache_dir == os.path.expanduser("~/.foo/")
def test_falsey_path_none(self):
wc = wheel.WheelCache(False, None)
assert wc._cache_dir is None