diff --git a/rcon/rconshell.py b/rcon/rconshell.py index ba6b711..810536e 100644 --- a/rcon/rconshell.py +++ b/rcon/rconshell.py @@ -1,6 +1,7 @@ """An interactive RCON shell.""" from argparse import ArgumentParser, Namespace +from contextlib import suppress from logging import INFO, basicConfig, getLogger from pathlib import Path from readline import read_history_file, write_history_file @@ -42,7 +43,9 @@ def main(): args = get_args() basicConfig(level=INFO, format=LOG_FORMAT) - read_history_file(HIST_FILE) + + with suppress(FileNotFoundError): + read_history_file(HIST_FILE) if args.server: host, port, passwd = get_credentials(args)