From e3563c1d0d1137d1397463fedeb754db61067677 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 24 Jul 2020 14:09:48 +0200 Subject: items: Use commonpath() instead of commonprefix() This ensures that we get a valid path. --- rtemsspec/items.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtemsspec/items.py b/rtemsspec/items.py index 4da02dde..2f4d80ac 100644 --- a/rtemsspec/items.py +++ b/rtemsspec/items.py @@ -455,7 +455,7 @@ class ItemCache: def _load_items_recursive(self, base: str, path: str, cache_dir: str) -> None: mid = os.path.abspath(path) - mid = mid.replace(os.path.commonprefix([cache_dir, mid]), "") + mid = mid.replace(os.path.commonpath([cache_dir, mid]), "").strip("/") cache_file = os.path.join(cache_dir, mid, "spec.pickle") try: mtime = os.path.getmtime(cache_file) -- cgit v1.2.3