diff --git a/vmas/scenarios/__init__.py b/vmas/scenarios/__init__.py index 860d75ad..d9c103d7 100644 --- a/vmas/scenarios/__init__.py +++ b/vmas/scenarios/__init__.py @@ -12,7 +12,7 @@ def load(name: str): for dirpath, _, filenames in os.walk(osp.dirname(__file__)): if pathname is None: for filename in filenames: - if name == filename or name == str(Path(dirpath) / Path(filename)): + if name == filename or Path(name) == Path(dirpath) / Path(filename): pathname = os.path.join(dirpath, filename) break assert pathname is not None, f"{name} scenario not found."