Repository: PokemonGoF/PokemonGo-Bot

Issue:
NameError: global name 'id_list2' is not defined
### Expected Behavior

After capturing a pokemon, I'd expect the program to continue running
### Actual Behavior

Spits out this error after catching the first pokemon:

> 2016-07-23 21:37:07 [x] PokemonGO Bot v1.0
> 2016-07-23 21:37:07 [x] Configuration initialized
> [2016-07-23 21:37:07] 
> [2016-07-23 21:37:07] [x] Address found: Santa Monica Pier, CA
> [2016-07-23 21:37:07] [x] Position in-game set as: (34.0092419, -118.4976037, 0.0)
> [2016-07-23 21:37:07] 
> [2016-07-23 21:37:10] [#] Username: ************
> [2016-07-23 21:37:10] [#] Acccount Creation: 2016-07-14 09:50:08.041000
> [2016-07-23 21:37:10] [#] Bag Storage: 334/350
> [2016-07-23 21:37:10] [#] Pokemon Storage: 162/250
> [2016-07-23 21:37:10] [#] Stardust: 42744
> [2016-07-23 21:37:10] [#] Pokecoins: 0
> [2016-07-23 21:37:10] [#] PokeBalls: 6
> [2016-07-23 21:37:10] [#] GreatBalls: 18
> [2016-07-23 21:37:10] [#] UltraBalls: 0
> [2016-07-23 21:37:11] [#] -- Level: 15
> [2016-07-23 21:37:11] [#] -- Experience: 109620
> [2016-07-23 21:37:11] [#] -- Experience until next level: 10380
> [2016-07-23 21:37:11] [#] -- Pokemon Captured: 371
> [2016-07-23 21:37:11] [#] -- Pokestops Visited: 145
> [2016-07-23 21:37:11] [#]
> 2016-07-23 21:37:11 [x] Starting PokemonGo Bot....
> [2016-07-23 21:37:11] [#] Scanning area for objects (1 / 2500)
> [2016-07-23 21:37:11] [#] Walking from (34.0092419, -118.4976037) to (34.0092419, -118.4976037) for approx. 0.00 seconds
> [#](34.0092419, -118.4976037, 0)
> [2016-07-23 21:37:11] [#] Something rustles nearby!
> 2016-07-23 21:37:11 [#] A Wild Spearow appeared! [CP 217] [Potential 0.29]
> [2016-07-23 21:37:11] [#] IV [Stamina/Attack/Defense] = [0/0/13]
> [2016-07-23 21:37:15] [x] Using Pokeball... (5 left!)
> 2016-07-23 21:37:16 [x] Captured Spearow! [CP 217] [IV 0.29] - Checking Release Config
> Traceback (most recent call last):
>   File "pokecli.py", line 203, in <module>
>     main()
>   File "pokecli.py", line 194, in main
>     bot.take_step()
>   File "/Users/peter/Code/Python/PokemonGo-Bot/pokemongo_bot/**init**.py", line 36, in take_step
>     self.stepper.take_step()
>   File "/Users/peter/Code/Python/PokemonGo-Bot/pokemongo_bot/stepper.py", line 67, in take_step
>     self._work_at_position(position[0], position[1], position[2], True)
>   File "/Users/peter/Code/Python/PokemonGo-Bot/pokemongo_bot/stepper.py", line 140, in _work_at_position
>     self.bot.work_on_cell(cell, position, pokemon_only)
>   File "/Users/peter/Code/Python/PokemonGo-Bot/pokemongo_bot/__init__.py", line 91, in work_on_cell
>     if worker.work() == -1:
>   File "/Users/peter/Code/Python/PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_catch_worker.py", line 137, in work
>     pokemon_to_transfer = list(Set(id_list2) - Set(id_list1))
> NameError: global name 'id_list2' is not defined
### Steps to Reproduce

Run the following:
`python pokecli.py -a google -u ******@gmail.com -p ****** -l "Santa Monica Pier, CA"`
### Other Information

OS: Max OSX Yosemite 10.11.6 AND Ubuntu 14.04
Git Commit: 911cb655714d8d75d0f3d4f2c4a71ac8a1e86749



Discussion:
Also getting this . . .

Latest dev, fresh env


Resolving patch:
diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py
--- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py
+++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py
@@ -134,6 +134,9 @@ def work(self):
                                             pokemon_potential
                                         ), 'green'
                                     )
+                                    
+                                    id_list2 = self.count_pokemon_inventory()
+
                                     pokemon_to_transfer = list(Set(id_list2) - Set(id_list1))
                                     self.api.evolve_pokemon(pokemon_id=pokemon_to_transfer[0])
                                     response_dict = self.api.call()


Test patch: