Remove releasedata.py's Product.has_version method

This method is hardly used, so using Product.get_version instead is a better choice.
This commit is contained in:
Marc Wrobel
2024-01-29 21:53:22 +01:00
parent 41af09512c
commit 651666f594
2 changed files with 6 additions and 8 deletions

View File

@@ -57,9 +57,6 @@ class Product:
return product
def has_version(self, version: str) -> bool:
return version in self.versions
def get_version(self, version: str) -> ProductVersion:
return self.versions[version] if version in self.versions else None
@@ -76,7 +73,7 @@ class Product:
self.declare_version(version, date)
def remove_version(self, version: str) -> None:
if not self.has_version(version):
if not self.get_version(version):
logging.warning(f"version {version} cannot be removed as it does not exist for {self}")
return