X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/f2ea461e9e9fa5c47bb61fd72d512c748928badc..05e1fbf27d93df36b09c560791ad46c6ce3eb518:/src/black/cache.py?ds=sidebyside diff --git a/src/black/cache.py b/src/black/cache.py index 017a2a9..bca7279 100644 --- a/src/black/cache.py +++ b/src/black/cache.py @@ -6,7 +6,7 @@ from pathlib import Path import tempfile from typing import Dict, Iterable, Set, Tuple -from appdirs import user_cache_dir +from platformdirs import user_cache_dir from black.mode import Mode @@ -35,7 +35,7 @@ def read_cache(mode: Mode) -> Cache: with cache_file.open("rb") as fobj: try: cache: Cache = pickle.load(fobj) - except (pickle.UnpicklingError, ValueError): + except (pickle.UnpicklingError, ValueError, IndexError): return {} return cache