From eaa6d34e2e8bfb9d1d0e70da4989526ac914d60b Mon Sep 17 00:00:00 2001 From: FzOrb <86922118+fzorb@users.noreply.github.com> Date: Thu, 26 Dec 2024 11:48:57 +0200 Subject: [PATCH] forgot to check if file existed before removing it award --- www.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www.py b/www.py index 7a861d1..8230d38 100644 --- a/www.py +++ b/www.py @@ -39,6 +39,9 @@ def renderIndex(ct, latest): template = environment.get_template("index.html") render = template.render(ct=datetime.fromtimestamp(int(ct)), latest=latest, render=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), sha256Linux=sha256Linux, sha256Windows=sha256Windows, sha512Linux=sha512Linux, sha512Windows=sha512Windows, md5Linux=md5Linux, md5Windows=md5Windows) - os.remove("./www/output/index.html") + try: + os.remove("./www/output/index.html") + except FileNotFoundError: + pass with open("./www/output/index.html", "x+") as file: file.write(render) \ No newline at end of file