From 8fee5adf47cf7e9e4c66f2b4b2ee1f88aae1fb90 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sat, 30 May 2020 18:43:56 +0200 Subject: [PATCH] fedora-helper: Do not fail if unlink() fails Signed-off-by: Igor Raits --- tools/fedora-helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/fedora-helper.py b/tools/fedora-helper.py index 491ea23..17d30ad 100755 --- a/tools/fedora-helper.py +++ b/tools/fedora-helper.py @@ -131,7 +131,10 @@ def get_binary_license(ctx, source, add, verbose): if repo.iscontiguous(): repo.empty() repo.add_solv(tmp.name) - os.unlink(cache_file) + try: + os.unlink(cache_file) + except FileNotFoundError: + pass os.link(tmp.name, cache_file) repo_local = pool.add_repo("local")