Skip to content

Commit 5952b71

Browse files
committed
Remove unused context manager code from AbstractMenu
1 parent 55fd59d commit 5952b71

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

archinstall/lib/menu/abstract_menu.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
from __future__ import annotations
22

3-
from typing import Any, Self
3+
from typing import Any
44

55
from archinstall.lib.translationhandler import tr
6-
from archinstall.tui.curses_menu import SelectMenu, Tui
6+
from archinstall.tui.curses_menu import SelectMenu
77
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
88
from archinstall.tui.result import ResultType
99
from archinstall.tui.types import Chars, FrameProperties, FrameStyle, PreviewStyle
1010

11-
from ..output import error
12-
1311
CONFIG_KEY = '__config__'
1412

1513

@@ -28,24 +26,8 @@ def __init__(
2826
self._allow_reset = allow_reset
2927
self._reset_warning = reset_warning
3028

31-
self.is_context_mgr = False
32-
3329
self._sync_from_config()
3430

35-
def __enter__(self, *args: Any, **kwargs: Any) -> Self:
36-
self.is_context_mgr = True
37-
return self
38-
39-
def __exit__(self, *args: Any, **kwargs: Any) -> None:
40-
# TODO: https://stackoverflow.com/questions/28157929/how-to-safely-handle-an-exception-inside-a-context-manager
41-
# TODO: skip processing when it comes from a planified exit
42-
if len(args) >= 2 and args[1]:
43-
error(args[1])
44-
Tui.print('Please submit this issue (and file) to https://github.com/archlinux/archinstall/issues')
45-
raise args[1]
46-
47-
self.sync_all_to_config()
48-
4931
def _sync_from_config(self) -> None:
5032
for item in self._menu_item_group._menu_items:
5133
if item.key is not None and not item.key.startswith(CONFIG_KEY):

0 commit comments

Comments
 (0)