Skip to content

Commit 6333d02

Browse files
committed
Remove extraneous None type annotations
1 parent 52face9 commit 6333d02

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

archinstall/lib/general.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __init__(
104104
cmd: str | list[str],
105105
peek_output: bool | None = False,
106106
environment_vars: dict[str, str] | None = None,
107-
working_directory: str | None = './',
107+
working_directory: str = './',
108108
remove_vt100_escape_codes_from_lines: bool = True,
109109
):
110110
if isinstance(cmd, str):
@@ -323,7 +323,7 @@ def __init__(
323323
cmd: str | list[str],
324324
peek_output: bool | None = False,
325325
environment_vars: dict[str, str] | None = None,
326-
working_directory: str | None = './',
326+
working_directory: str = './',
327327
remove_vt100_escape_codes_from_lines: bool = True,
328328
):
329329
self.cmd = cmd
@@ -349,7 +349,7 @@ def __iter__(self, *args: list[Any], **kwargs: dict[str, Any]) -> Iterator[bytes
349349
if self.session:
350350
yield from self.session
351351

352-
def __getitem__(self, key: slice) -> bytes | None:
352+
def __getitem__(self, key: slice) -> bytes:
353353
if not self.session:
354354
raise KeyError('SysCommand() does not have an active session.')
355355
elif type(key) is slice:

archinstall/lib/locale/locale_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _define_menu_options(self) -> list[MenuItem]:
5151
),
5252
]
5353

54-
def _prev_locale(self, item: MenuItem) -> str | None:
54+
def _prev_locale(self, item: MenuItem) -> str:
5555
temp_locale = LocaleConfiguration(
5656
self._menu_item_group.find_by_key('kb_layout').get_value(),
5757
self._menu_item_group.find_by_key('sys_lang').get_value(),

archinstall/lib/mirrors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _define_menu_options(self) -> list[MenuItem]:
258258
),
259259
]
260260

261-
def _prev_regions(self, item: MenuItem) -> str | None:
261+
def _prev_regions(self, item: MenuItem) -> str:
262262
regions = item.get_value()
263263

264264
output = ''
@@ -438,7 +438,7 @@ def get_status_by_region(self, region: str, speed_sort: bool) -> list[MirrorStat
438438
region_list = mappings[region]
439439
return sorted(region_list, key=lambda mirror: (mirror.score, mirror.speed))
440440

441-
def _parse_remote_mirror_list(self, mirrorlist: str) -> dict[str, list[MirrorStatusEntryV3]] | None:
441+
def _parse_remote_mirror_list(self, mirrorlist: str) -> dict[str, list[MirrorStatusEntryV3]]:
442442
mirror_status = MirrorStatusListV3.model_validate_json(mirrorlist)
443443

444444
sorting_placeholder: dict[str, list[MirrorStatusEntryV3]] = {}
@@ -472,7 +472,7 @@ def _parse_remote_mirror_list(self, mirrorlist: str) -> dict[str, list[MirrorSta
472472

473473
return sorted_by_regions
474474

475-
def _parse_locale_mirrors(self, mirrorlist: str) -> dict[str, list[MirrorStatusEntryV3]] | None:
475+
def _parse_locale_mirrors(self, mirrorlist: str) -> dict[str, list[MirrorStatusEntryV3]]:
476476
lines = mirrorlist.splitlines()
477477

478478
# remove empty lines

archinstall/lib/models/device_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ def json(self) -> _SnapshotConfigSerialization:
13691369
return {'type': self.snapshot_type.value}
13701370

13711371
@staticmethod
1372-
def parse_args(args: _SnapshotConfigSerialization) -> SnapshotConfig | None:
1372+
def parse_args(args: _SnapshotConfigSerialization) -> SnapshotConfig:
13731373
return SnapshotConfig(SnapshotType(args['type']))
13741374

13751375

archinstall/lib/plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _localize_path(path: Path) -> Path:
4545
return path
4646

4747

48-
def _import_via_path(path: Path, namespace: str | None = None) -> str | None:
48+
def _import_via_path(path: Path, namespace: str | None = None) -> str:
4949
if not namespace:
5050
namespace = os.path.basename(path)
5151

archinstall/tui/curses_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ def print(
12941294
text: str,
12951295
row: int = 0,
12961296
col: int = 0,
1297-
endl: str | None = '\n',
1297+
endl: str = '\n',
12981298
clear_screen: bool = False,
12991299
) -> None:
13001300
if clear_screen:

0 commit comments

Comments
 (0)