diff --git a/micropip/_commands/index_urls.py b/micropip/_commands/index_urls.py index 60cc9b1..aae9cce 100644 --- a/micropip/_commands/index_urls.py +++ b/micropip/_commands/index_urls.py @@ -24,4 +24,4 @@ def set_index_urls(urls: list[str] | str) -> None: if isinstance(urls, str): urls = [urls] - package_index.INDEX_URLS = urls + package_index.INDEX_URLS = urls[:] diff --git a/micropip/_commands/install.py b/micropip/_commands/install.py index 155eab0..bc93c1f 100644 --- a/micropip/_commands/install.py +++ b/micropip/_commands/install.py @@ -127,7 +127,7 @@ async def install( wheel_base = Path(getsitepackages()[0]) if index_urls is None: - index_urls = package_index.INDEX_URLS + index_urls = package_index.INDEX_URLS[:] transaction = Transaction( ctx=ctx,