Fix frozenset error in clear_cache

The repos attribute from scan_cache_dir() is a frozenset, not a list,
so .pop() doesn't work. Fixed by using next(iter()) instead.
parent 2c0ed5db
......@@ -868,8 +868,8 @@ def clear_cache(yes=False):
else:
print(" ⚠️ Auto-confirming cache clear due to --yes flag")
# Get cache directory path
cache_dir = cache_info.repos.pop().repo_path.parent
# Get cache directory path (repos is a frozenset, so use next() to get one item)
cache_dir = next(iter(cache_info.repos)).repo_path.parent
# Delete all cache contents
for item in cache_dir.iterdir():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment