diff --git a/pre_commit/languages/conda.py b/pre_commit/languages/conda.py index a9c1499c..fe17a2d0 100644 --- a/pre_commit/languages/conda.py +++ b/pre_commit/languages/conda.py @@ -80,7 +80,8 @@ def install_environment( tmp_env_file.name, cwd=prefix.prefix_dir, ) finally: - os.remove(tmp_env_file.name) + if os.path.exists(tmp_env_file.name): + os.remove(tmp_env_file.name) def run_hook(