Skip to content

dev branch crash in incubate_eggs_worker #1766

@Donwulff

Description

@Donwulff

Expected behaviour is that the bot doesn't crash. :) Actual behaviour:
[06:05:41] Moving towards fort 71db06db5f9447bba4a35b33d3a2eaf2.16, 0.47km left
[06:05:46] Moving towards fort 71db06db5f9447bba4a35b33d3a2eaf2.16, 0.46km left
Traceback (most recent call last):
File "pokecli.py", line 450, in
main()
File "pokecli.py", line 68, in main
bot.tick()
File "C:\Miniconda2\envs\PokemonGo-Bot-dev\pokemongo_bot__init__.py", line 84, in tick
if worker.work() == WorkerResult.RUNNING:
File "C:\Miniconda2\envs\PokemonGo-Bot-dev\pokemongo_bot\cell_workers\incubate_eggs_worker.py", line 29, in work
self._hatch_eggs()
File "C:\Miniconda2\envs\PokemonGo-Bot-dev\pokemongo_bot\cell_workers\incubate_eggs_worker.py", line 134, in _hatch_eggs
for pokemon in pokemon_data:
UnboundLocalError: local variable 'pokemon_data' referenced before assignment

Just above it looks to be try-except statement for assigning to pokemon_data. It's been over a decade since I've had to know Python intimately, so I'm not certain which circumstances could cause it to become unassigned. But it seems like either that except-branch needs to skip the whole following code, or the try branch needs to assign to temporary and assign it over to pokemon_data only if that succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions