From 17b1ece7c1674b29e9b5767c28b321b9fbf5c7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Mon, 1 Jan 2024 09:26:55 +0000 Subject: [PATCH] Remove new year error --- statsgen.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/statsgen.py b/statsgen.py index fb2001f..e7f0b9f 100644 --- a/statsgen.py +++ b/statsgen.py @@ -745,13 +745,16 @@ def yeargen(local=False): filewrite.write("\">« " + str(prevyear) + "") thisyear = int(datetime.datetime.now().strftime("%Y")) if year < thisyear: - nextyear = yearlist[listposition + 1] - filewrite.write("" + str(nextyear) + " »") + try: + nextyear = yearlist[listposition + 1] + filewrite.write("" + str(nextyear) + " »") + except: + pass filewrite.write("

\n\n\n") filewrite.close()