From c0ba6d46ea0eae970e8cc89f2ad61eaa0c1576c3 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Tue, 6 Jan 2026 20:55:42 -0500 Subject: [PATCH] Avoid a reportPossiblyUnboundVariable warning with Pyright --- archinstall/lib/interactions/system_conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/interactions/system_conf.py b/archinstall/lib/interactions/system_conf.py index 534e1a7d81..2f11362f7b 100644 --- a/archinstall/lib/interactions/system_conf.py +++ b/archinstall/lib/interactions/system_conf.py @@ -1,5 +1,7 @@ from __future__ import annotations +from typing import assert_never + from archinstall.lib.models.application import ZramAlgorithm, ZramConfiguration from archinstall.lib.translationhandler import tr from archinstall.tui.curses_menu import SelectMenu @@ -126,12 +128,15 @@ def ask_for_swap(preset: ZramConfiguration = ZramConfiguration(enabled=True)) -> allow_skip=True, ).run() - algo: ZramAlgorithm match algo_result.type_: case ResultType.Skip: algo = preset.algorithm case ResultType.Selection: algo = algo_result.get_value() + case ResultType.Reset: + raise ValueError('Unhandled result type') + case _: + assert_never(algo_result.type_) return ZramConfiguration(enabled=True, algorithm=algo) case ResultType.Reset: