Fix a couple of type issues
This commit is contained in:
parent
5a048f7ae8
commit
daa920c845
2 changed files with 4 additions and 4 deletions
|
|
@ -69,7 +69,7 @@ class BuildsDb:
|
|||
return None
|
||||
return self._build_from_row(row)
|
||||
|
||||
def remove(self, name: str) -> None:
|
||||
def remove(self, name: str) -> bool:
|
||||
if self.get(name) is None:
|
||||
return False # no change
|
||||
with self._con:
|
||||
|
|
@ -77,7 +77,7 @@ class BuildsDb:
|
|||
_logger.info("Noticed removal of %s", name)
|
||||
return True
|
||||
|
||||
def add(self, build: Build) -> None:
|
||||
def add(self, build: Build) -> bool:
|
||||
prev_build = self.get(build.name)
|
||||
if prev_build == build:
|
||||
return False # no change
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ class Build(BaseModel):
|
|||
def __str__(self) -> str:
|
||||
return f"{self.slug} ({self.name})"
|
||||
|
||||
def __eq__(self, other: "Build") -> bool:
|
||||
if other is None:
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if not isinstance(other, Build):
|
||||
return False
|
||||
if self.name != other.name:
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in a new issue