Fix loading old configs with version numbers
This commit is contained in:
parent
2909e285fc
commit
b3a3b9e4f1
|
@ -312,19 +312,13 @@ class Config(object):
|
|||
try:
|
||||
self.__format_version = int(data.readline())
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
data.seek(0)
|
||||
else:
|
||||
try:
|
||||
self.__file_version = int(data.readline())
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
||||
if not self.__format_version:
|
||||
data.seek(0)
|
||||
self.__format_version = 1
|
||||
self.__file_version = 1
|
||||
|
||||
fdata = data.read()
|
||||
data.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue