Skip to content

Commit ae0b4a7

Browse files
committed
Merge pull request #2856 from dstufft/support-falsey-cache-dir
Support a falsey cache-dir
2 parents f25aef0 + 9089430 commit ae0b4a7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pip/wheel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, cache_dir, format_control):
5555
:param format_control: A pip.index.FormatControl object to limit
5656
binaries being read from the cache.
5757
"""
58-
self._cache_dir = os.path.expanduser(cache_dir)
58+
self._cache_dir = os.path.expanduser(cache_dir) if cache_dir else None
5959
self._format_control = format_control
6060

6161
def cached_wheel(self, link, package_name):

tests/unit/test_wheel.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,7 @@ class TestWheelCache:
397397
def test_expands_path(self):
398398
wc = wheel.WheelCache("~/.foo/", None)
399399
assert wc._cache_dir == os.path.expanduser("~/.foo/")
400+
401+
def test_falsey_path_none(self):
402+
wc = wheel.WheelCache(False, None)
403+
assert wc._cache_dir is None

0 commit comments

Comments
 (0)