Skip to content

Commit 7c87a31

Browse files
committed
Fix remaining Pyright warnings
1 parent 39c25a0 commit 7c87a31

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

archinstall/lib/models/device.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,6 @@ class Size:
316316
unit: Unit
317317
sector_size: SectorSize
318318

319-
def __post_init__(self) -> None:
320-
if not isinstance(self.sector_size, SectorSize):
321-
raise ValueError('sector size must be of type SectorSize')
322-
323319
def json(self) -> _SizeSerialization:
324320
return {
325321
'value': self.value,
@@ -351,7 +347,9 @@ def convert(
351347
norm = self._normalize()
352348
return Size(norm, Unit.B, self.sector_size).convert(target_unit, sector_size)
353349
else:
354-
if target_unit == Unit.sectors and sector_size is not None:
350+
if target_unit == Unit.sectors:
351+
assert sector_size is not None
352+
355353
norm = self._normalize()
356354
sectors = math.ceil(norm / sector_size.value)
357355
return Size(sectors, Unit.sectors, sector_size)

0 commit comments

Comments
 (0)