From f31644f7730802c0a5b628f0dd2b5a09076df978 Mon Sep 17 00:00:00 2001 From: valefar-on-discord <124839138+valefar-on-discord@users.noreply.github.com> Date: Sun, 29 Sep 2024 18:14:32 -0500 Subject: [PATCH] Use sys.exit instead of exit (#176) --- ethstaker_deposit/cli/exit_transaction_keystore.py | 3 ++- .../cli/generate_bls_to_execution_change_keystore.py | 5 +++-- ethstaker_deposit/cli/partial_deposit.py | 3 ++- ethstaker_deposit/cli/test_keystore.py | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ethstaker_deposit/cli/exit_transaction_keystore.py b/ethstaker_deposit/cli/exit_transaction_keystore.py index 8ce3d607..faa4b730 100644 --- a/ethstaker_deposit/cli/exit_transaction_keystore.py +++ b/ethstaker_deposit/cli/exit_transaction_keystore.py @@ -1,5 +1,6 @@ import click import os +import sys import time from typing import Any, Optional @@ -117,7 +118,7 @@ def exit_transaction_keystore( secret_bytes = keystore.decrypt(keystore_password) except ValueError: click.echo(load_text(['arg_exit_transaction_keystore_keystore_password', 'mismatch']), err=True) - exit(1) + sys.exit(1) signing_key = int.from_bytes(secret_bytes, 'big') diff --git a/ethstaker_deposit/cli/generate_bls_to_execution_change_keystore.py b/ethstaker_deposit/cli/generate_bls_to_execution_change_keystore.py index 1b0470df..f65b0a74 100644 --- a/ethstaker_deposit/cli/generate_bls_to_execution_change_keystore.py +++ b/ethstaker_deposit/cli/generate_bls_to_execution_change_keystore.py @@ -1,6 +1,7 @@ +import click import os +import sys import time -import click from typing import Any, Optional from eth_typing import HexAddress @@ -132,7 +133,7 @@ def generate_bls_to_execution_change_keystore( secret_bytes = keystore.decrypt(keystore_password) except ValueError: click.echo(load_text(['arg_bls_to_execution_changes_keystore_keystore_password', 'mismatch']), err=True) - exit(1) + sys.exit(1) signing_key = int.from_bytes(secret_bytes, 'big') diff --git a/ethstaker_deposit/cli/partial_deposit.py b/ethstaker_deposit/cli/partial_deposit.py index b8029f7f..7c925a64 100644 --- a/ethstaker_deposit/cli/partial_deposit.py +++ b/ethstaker_deposit/cli/partial_deposit.py @@ -1,6 +1,7 @@ import json import click import os +import sys import time from eth_typing import HexAddress @@ -139,7 +140,7 @@ def partial_deposit( secret_bytes = keystore.decrypt(keystore_password) except ValueError: click.echo(load_text(['arg_partial_deposit_keystore_password', 'mismatch']), err=True) - exit(1) + sys.exit(1) signing_key = int.from_bytes(secret_bytes, 'big') diff --git a/ethstaker_deposit/cli/test_keystore.py b/ethstaker_deposit/cli/test_keystore.py index b61ce0f5..f7a64269 100644 --- a/ethstaker_deposit/cli/test_keystore.py +++ b/ethstaker_deposit/cli/test_keystore.py @@ -1,4 +1,5 @@ import click +import sys from typing import Any from ethstaker_deposit.key_handling.keystore import Keystore @@ -54,7 +55,7 @@ def test_keystore( keystore.decrypt(keystore_password) except ValueError: click.echo(load_text(['arg_test_keystore_keystore_password', 'mismatch']), err=True) - exit(1) + sys.exit(1) click.echo(load_text(['msg_verification_success'])) if not config.non_interactive: