Use assert_never to fix some possibly-undefined mypy warnings (#3333)
This commit is contained in:
parent
5af2d2bb07
commit
1678fb5192
|
|
@ -1,5 +1,5 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, assert_never, override
|
||||||
|
|
||||||
from archinstall.lib.models.device_model import SubvolumeModification
|
from archinstall.lib.models.device_model import SubvolumeModification
|
||||||
from archinstall.tui.curses_menu import EditMenu
|
from archinstall.tui.curses_menu import EditMenu
|
||||||
|
|
@ -54,6 +54,8 @@ class SubvolumeMenu(ListManager):
|
||||||
name = result.text()
|
name = result.text()
|
||||||
case ResultType.Reset:
|
case ResultType.Reset:
|
||||||
raise ValueError('Unhandled result type')
|
raise ValueError('Unhandled result type')
|
||||||
|
case _:
|
||||||
|
assert_never(result.type_)
|
||||||
|
|
||||||
header = f"{_('Subvolume name')}: {name}\n"
|
header = f"{_('Subvolume name')}: {name}\n"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING, assert_never
|
||||||
|
|
||||||
from archinstall.lib.models.packages import Repository
|
from archinstall.lib.models.packages import Repository
|
||||||
from archinstall.lib.packages.packages import list_available_packages
|
from archinstall.lib.packages.packages import list_available_packages
|
||||||
|
|
@ -263,6 +263,8 @@ def add_number_of_parallel_downloads(preset: int | None = None) -> int | None:
|
||||||
return 0
|
return 0
|
||||||
case ResultType.Selection:
|
case ResultType.Selection:
|
||||||
downloads: int = int(result.text())
|
downloads: int = int(result.text())
|
||||||
|
case _:
|
||||||
|
assert_never(result.type_)
|
||||||
|
|
||||||
pacman_conf_path = Path("/etc/pacman.conf")
|
pacman_conf_path = Path("/etc/pacman.conf")
|
||||||
with pacman_conf_path.open() as f:
|
with pacman_conf_path.open() as f:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue