fix args rename

This commit is contained in:
2019-09-15 01:37:30 +03:00
parent e181e074b1
commit 36f0b8151a
4 changed files with 10 additions and 8 deletions

View File

@ -6,4 +6,4 @@
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
__version__ = '0.1.0'
__version__ = '0.1.1'

View File

@ -46,7 +46,9 @@ class Piece(Serializable):
@classmethod
def get(cls: Type[Piece], data: Mapping[str, Any]) -> Union[Piece, Upgrade]:
try:
piece_type = data['piece']
piece_type = data.get('piece') or data.get('name')
if piece_type is None:
raise KeyError
is_tome = data['is_tome'] in ('yes', 'on', '1', 1, True)
except KeyError:
raise InvalidDataRow(data)