Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions archinstall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _check_online() -> None:
if not arch_config_handler.args.skip_wifi_check:
success = not wifi_handler.setup()
if not success:
exit(0)
sys.exit(0)


def _fetch_arch_db() -> None:
Expand All @@ -63,7 +63,7 @@ def _fetch_arch_db() -> None:
error('Run archinstall --debug and check /var/log/archinstall/install.log for details.')

debug(f'Failed to sync Arch Linux package database: {e}')
exit(1)
sys.exit(1)


def check_version_upgrade() -> str | None:
Expand Down Expand Up @@ -151,7 +151,7 @@ def run_as_a_module() -> None:
warn(text)
rc = 1

exit(rc)
sys.exit(rc)


__all__ = [
Expand Down
9 changes: 5 additions & 4 deletions archinstall/lib/args.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import json
import os
import sys
import urllib.error
import urllib.parse
from argparse import ArgumentParser, Namespace
Expand Down Expand Up @@ -266,7 +267,7 @@ def __init__(self) -> None:
self._config.version = self._get_version()
except ValueError as err:
warn(str(err))
exit(1)
sys.exit(1)

@property
def config(self) -> ArchConfig:
Expand Down Expand Up @@ -492,7 +493,7 @@ def _process_creds_data(self, creds_data: str) -> dict[str, Any] | None:
except ValueError as err:
if 'Invalid password' in str(err):
error(tr('Incorrect credentials file decryption password'))
exit(1)
sys.exit(1)
else:
debug(f'Error decrypting credentials file: {err}')
raise err from err
Expand Down Expand Up @@ -537,12 +538,12 @@ def _fetch_from_url(self, url: str) -> str:
else:
error('Not a valid url')

exit(1)
sys.exit(1)

def _read_file(self, path: Path) -> str:
if not path.exists():
error(f'Could not find file {path}')
exit(1)
sys.exit(1)

return path.read_text()

Expand Down
3 changes: 2 additions & 1 deletion archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from typing import override

from archinstall.lib.disk.disk_menu import DiskLayoutConfigurationMenu
Expand Down Expand Up @@ -174,7 +175,7 @@ def _get_menu_options(self) -> list[MenuItem]:
),
MenuItem(
text=tr('Abort'),
action=lambda x: exit(1),
action=lambda x: sys.exit(1),
key=f'{CONFIG_KEY}_abort',
),
]
Expand Down
3 changes: 2 additions & 1 deletion archinstall/lib/interactions/general_conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from enum import Enum
from pathlib import Path
from typing import assert_never
Expand Down Expand Up @@ -305,4 +306,4 @@ def ask_abort() -> None:
).run()

if result.item() == MenuItem.yes():
exit(0)
sys.exit(0)
3 changes: 2 additions & 1 deletion archinstall/lib/pacman/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import time
from collections.abc import Callable
from pathlib import Path
Expand Down Expand Up @@ -35,7 +36,7 @@ def run(args: str, default_cmd: str = 'pacman') -> SysCommand:

if time.time() - started > (60 * 10):
error(tr('Pre-existing pacman lock never exited. Please clean up any existing pacman sessions before using archinstall.'))
exit(1)
sys.exit(1)

return SysCommand(f'{default_cmd} {args}')

Expand Down
3 changes: 2 additions & 1 deletion archinstall/scripts/guided.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import time
from pathlib import Path

Expand Down Expand Up @@ -194,7 +195,7 @@ def guided() -> None:
config.save()

if arch_config_handler.args.dry_run:
exit(0)
sys.exit(0)

if not arch_config_handler.args.silent:
aborted = False
Expand Down
3 changes: 2 additions & 1 deletion archinstall/scripts/minimal.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from pathlib import Path

from archinstall.default_profiles.minimal import MinimalProfile
Expand Down Expand Up @@ -69,7 +70,7 @@ def _minimal() -> None:
config.save()

if arch_config_handler.args.dry_run:
exit(0)
sys.exit(0)

if not arch_config_handler.args.silent:
aborted = False
Expand Down
3 changes: 2 additions & 1 deletion archinstall/scripts/only_hd.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from pathlib import Path

from archinstall import debug, error
Expand Down Expand Up @@ -65,7 +66,7 @@ def _only_hd() -> None:
config.save()

if arch_config_handler.args.dry_run:
exit(0)
sys.exit(0)

if not arch_config_handler.args.silent:
aborted = False
Expand Down