1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

fixed2: allow game restore to accept older storage format.

This commit is contained in:
lufebe16 2019-09-27 11:24:03 +02:00
parent 97267e9a77
commit 92f2d5f602

View file

@ -3135,7 +3135,14 @@ class Game(object):
def pload(t=None, p=p):
obj = p.load()
if isinstance(t, type):
assert isinstance(obj, t), err_txt
if not isinstance(obj, t):
# accept old storage format in case:
if (t == GameMoves
or t == GameGlobalStatsStruct
or t == GameStatsStruct):
assert isinstance(obj, Struct), err_txt
else:
assert False, err_txt
return obj
def validate(v, txt):