Dentosal / python-sc2

A StarCraft II bot api client library for Python 3
MIT License
587 stars 182 forks source link

Logger gives an error for human players #223

Closed drakonnan1st closed 5 years ago

drakonnan1st commented 5 years ago

line 199 in main.py: logging.info(f"Result for player {player_id} ({player.ai.__class__.__name__}): {result._name_}") If one of the players is human, then once the game ends, we get this error: AttributeError: 'Human' object has no attribute 'ai'

Possible fix that still displays Bot's class name:

    typestring = player.ai.__class__.__name__ if isinstance(player, Bot) else player
    logging.info(f"Result for player {player_id} ({typestring}): {result._name_}")
tweakimp commented 5 years ago

Should be fixed now