Fix function missing parameter

By putting main into a function, other_state is no longer a global. Some
functions depended on this global dict, so pass it as a parameter
instead.
This commit is contained in:
Stephen Seo 2023-11-17 20:46:58 +09:00
parent c2d15ea593
commit f79849340e

View file

@ -1664,7 +1664,10 @@ def build_print_pkg_info(pkgs: tuple[str], other_state: dict[str, any]):
def test_gpg_passphrase( def test_gpg_passphrase(
signing_gpg_dir: str, signing_key_fp: str, passphrase: str signing_gpg_dir: str,
signing_key_fp: str,
passphrase: str,
other_state: dict[str, any],
): ):
"""Checks if the given gpg passphrase works with the gpg signing key.""" """Checks if the given gpg passphrase works with the gpg signing key."""
@ -1886,6 +1889,7 @@ def main():
other_state["signing_gpg_dir"], other_state["signing_gpg_dir"],
other_state["signing_gpg_key_fp"], other_state["signing_gpg_key_fp"],
other_state["signing_gpg_pass"], other_state["signing_gpg_pass"],
other_state,
): ):
sys.exit(1) sys.exit(1)
elif args.config: elif args.config:
@ -1987,6 +1991,7 @@ def main():
other_state["signing_gpg_dir"], other_state["signing_gpg_dir"],
other_state["signing_gpg_key_fp"], other_state["signing_gpg_key_fp"],
other_state["signing_gpg_pass"], other_state["signing_gpg_pass"],
other_state,
): ):
sys.exit(1) sys.exit(1)
if "editor" in d: if "editor" in d: