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:
commit
ae0b4a76ad
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue