From 9157e366d343242b182450ec9403c8da7bb2da46 Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Wed, 28 Feb 2024 18:03:18 +0100 Subject: [PATCH] sq --- src/resolve_robotics_uri_py/resolve_robotics_uri_py.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py b/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py index 507e82b..e77a54d 100644 --- a/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py +++ b/src/resolve_robotics_uri_py/resolve_robotics_uri_py.py @@ -90,8 +90,9 @@ def resolve_robotics_uri(uri: str) -> pathlib.Path: FileNotFoundError: If no file corresponding to the URI is found. """ - # If the URI has no scheme, use by default file:// - if ":/" not in uri: + # If the URI has no scheme, use by default file:// which maps the resolved input + # path to a URI with empty authority + if not any(uri.startswith(scheme) for scheme in SupportedSchemes): uri = f"file://{pathlib.Path(uri).resolve()}" # Get scheme from URI