Skip to content

Commit b31e497

Browse files
committed
Modifies the ReaderMap to automatically use the most current readers if the build isn't recognized (probably because its new). Previously it threw a key error which would make sc2reader unable to do even partial reads of new patches (which was bad).
1 parent 5c237f2 commit b31e497

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sc2reader/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ def __getitem__(self,key):
7979
'replay.game.events': GameEventsReader_16561(),
8080
}
8181

82-
elif int(key) in (18574,):
82+
#This one is also a catch all. If the build isn't recognized, try to use
83+
#the latest parsing code and hope that it works!
84+
elif int(key) in (18574,) or True:
8385
return {
8486
'replay.initData': InitDataReader(),
8587
'replay.details': DetailsReader(),
8688
'replay.attributes.events': AttributeEventsReader_17326(),
8789
'replay.message.events': MessageEventsReader(),
8890
'replay.game.events': GameEventsReader_18574(),
8991
}
90-
else:
91-
raise KeyError(key)
9292

9393
READERS = ReaderMap()
9494

0 commit comments

Comments
 (0)