Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'individual_attack' #958

Merged
merged 1 commit into from
Jul 26, 2016
Merged

KeyError: 'individual_attack' #958

merged 1 commit into from
Jul 26, 2016

Conversation

pace-noge
Copy link
Contributor

Short Description:

sometimes show unusual error like:

PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_catch_worker.py", line 55, in work
    pokemon['pokemon_data']['individual_attack'],
KeyError: 'individual_attack'

(i'm only use 0 for default but i know we used it to calculate IV, is there better default value?)
Fixes:

- use pokemon['pokemon_data'].get("individual_attack", 0) instead

@tstumm
Copy link
Contributor

tstumm commented Jul 26, 2016

This already fixed in dev

individual_attack = 0

individual_attack = pokemon['pokemon_data'].get("individual_attack", 0)
individual_stamina = pokemon['pokemon_data'].get("individual_stamina", 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is good.

@solderzzc solderzzc merged commit b107b56 into PokemonGoF:dev Jul 26, 2016
MFizz pushed a commit to MFizz/PokemonGo-Bot that referenced this pull request Jul 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants