summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-07-24 14:09:48 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-18 13:27:33 +0200
commite3563c1d0d1137d1397463fedeb754db61067677 (patch)
tree1aae397d0b008fdf884991c6a5243044d30fec8d
parentspecdoc: Make section texts configurable (diff)
downloadrtems-central-e3563c1d0d1137d1397463fedeb754db61067677.tar.bz2
items: Use commonpath() instead of commonprefix()
This ensures that we get a valid path.
-rw-r--r--rtemsspec/items.py2
1 files changed, 1 insertions, 1 deletions
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)