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:
parent
97267e9a77
commit
92f2d5f602
1 changed files with 8 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue