Fixing a few bugs in loading settings.settings.data

This commit is contained in:
Victorious Children Studios 2023-12-14 13:44:50 +02:00
parent 40d4a019bb
commit bbcf7764d4

View file

@ -26,9 +26,12 @@ def write(setting, value):
value = str(value) value = str(value)
#opening the file #opening the file
data = open("settings/settings.data") try:
data = data.read() data = open("settings/settings.data")
data = data.split("\n") data = data.read()
data = data.split("\n")
except:
data = ["Language = Unknown"]
#making a new file #making a new file
ndata = open("settings/settings.data", "w") ndata = open("settings/settings.data", "w")
@ -74,9 +77,12 @@ def load_all():
ret = {} ret = {}
# Opening the file. # Opening the file.
data = open("settings/settings.data") try:
data = data.read() data = open("settings/settings.data")
data = data.split("\n") data = data.read()
data = data.split("\n")
except:
data = ["Language = Unknown"]
# Parsing the file. # Parsing the file.
for d in data: for d in data: