KeyError: 'candy'
Expected Behavior
Actual Behavior
Traceback (most recent call last):
File "pokecli.py", line 470, in <module>
main()
File "pokecli.py", line 71, in main
bot.tick()
File "/home/lunik/pkm/pokemongo_bot/__init__.py", line 88, in tick
if worker.work() == WorkerResult.RUNNING:
File "/home/lunik/pkm/pokemongo_bot/cell_workers/transfer_pokemon.py", line 12, in work
candies = get_candies(self.bot)
File "/home/lunik/pkm/pokemongo_bot/cell_workers/utils.py", line 246, in get_candies
candies[candy['family_id']] = candy['candy']
KeyError: 'candy'
Steps to Reproduce
Commit: fbda65e3f063b23b5eddee87f6b3338e66710a8b
Other Information
OS: Linux Git Commit: fbda65e3f063b23b5eddee87f6b3338e66710a8b Python Version: Python 2.9.7
Expected Behavior
Bot loads and runs.
Actual Behavior
Traceback (most recent call last):
File "pokecli.py", line 470, in
Some candy arrays are missing elements. Here's a temporary fix that works for me. Modify the if candy != {}: line of ./pokemongo_bot/cell_workers/utils.py (near the end of the file) to look like this: if candy != {} and 'family_id' in candy and 'candy' in candy: