diff --git a/micropython/mip/manifest.py b/micropython/mip/manifest.py index f577ea601..96c8df630 100644 --- a/micropython/mip/manifest.py +++ b/micropython/mip/manifest.py @@ -1,4 +1,4 @@ -metadata(version="0.5.0", description="On-device package installer for network-capable boards") +metadata(version="0.5.1", description="On-device package installer for network-capable boards") require("requests") diff --git a/micropython/mip/mip/__init__.py b/micropython/mip/mip/__init__.py index 22982fe9a..dfe722288 100644 --- a/micropython/mip/mip/__init__.py +++ b/micropython/mip/mip/__init__.py @@ -121,7 +121,9 @@ def _install_json(package_json_url, index, target, version, mpy): if not _download_file(file_url, fs_target_path): print("File not found: {} {}".format(target_path, short_hash)) return False - base_url = package_json_url.rpartition("/")[0] + # str.rpartition is not available on all builds. + slash = package_json_url.rfind("/") + base_url = package_json_url[:slash] if slash >= 0 else "" for target_path, url in package_json.get("urls", ()): fs_target_path = target + "/" + target_path is_full_url = any(url.startswith(p) for p in _ALLOWED_MIP_URL_PREFIXES)