diff --git a/bypy/init_env.py b/bypy/init_env.py index f8e5b8d47..dee410601 100644 --- a/bypy/init_env.py +++ b/bypy/init_env.py @@ -7,6 +7,7 @@ import re import shutil import subprocess import sys +from contextlib import suppress from bypy.constants import ( LIBDIR, PREFIX, PYTHON, SRC as KITTY_DIR, ismacos, worker_env @@ -49,10 +50,8 @@ def build_c_extensions(ext_dir, args): ignore=shutil.ignore_patterns('b', 'build', 'dist', '*_commands.json', '*.o')) # Build the launcher as it is needed for the spawn test - try: + with suppress(FileNotFoundError): os.remove(os.path.join(writeable_src_dir, 'kitty', 'launcher', 'kitty')) - except FileNotFoundError: - pass if run(PYTHON, 'setup.py', 'build-launcher', cwd=writeable_src_dir) != 0: print('Building of kitty launcher failed', file=sys.stderr) os.chdir(KITTY_DIR)