From 8bf6e891a22507b6933c81833b73f4f66f4b3ed8 Mon Sep 17 00:00:00 2001 From: David Bold Date: Mon, 8 Jan 2024 17:03:36 +0100 Subject: [PATCH] Fix base_dir detection --- xbout/load.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xbout/load.py b/xbout/load.py index 5bd83dd3..acc55872 100644 --- a/xbout/load.py +++ b/xbout/load.py @@ -789,12 +789,14 @@ def _expand_wildcards(path): # Find first parent directory which does not contain a wildcard base_dir = path while True: - base_dir = str(base_dir.parent) - if "*" in base_dir: + _base_dir = str(base_dir.parent) + base_dir = Path(_base_dir) + if "*" in _base_dir: continue - if "{" in base_dir: + if "{" in _base_dir: + continue + if "[" in _base_dir: continue - base_dir = Path(base_dir) break # Find path relative to parent search_pattern = str(path.relative_to(base_dir))