From 74106dfb47332d8b1c653c8b550410a5c017a472 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sat, 25 Jun 2022 14:54:28 +0100 Subject: [PATCH] assert repository not added to pool twice --- src/poetry/repositories/pool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/poetry/repositories/pool.py b/src/poetry/repositories/pool.py index 0e68cc6997b..49f0c18adb7 100644 --- a/src/poetry/repositories/pool.py +++ b/src/poetry/repositories/pool.py @@ -62,6 +62,8 @@ def add_repository( Adds a repository to the pool. """ repository_name = repository.name.lower() + if repository_name in self._lookup: + raise RuntimeError(f"{repository_name} already in pool") if default: if self.has_default():