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

Fix instance where evolve_all is unicode - fixes #2281 #2305

Merged
merged 2 commits into from
Aug 2, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pokemongo_bot/cell_workers/evolve_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ def initialize(self):
self.evolve_speed = self.config.get('evolve_speed', 3.7)
self.evolve_cp_min = self.config.get('evolve_cp_min', 300)
self.use_lucky_egg = self.config.get('use_lucky_egg', False)
self._validate_config()

def _validate_config(self):
if isinstance(self.evolve_all, str):
if isinstance(self.evolve_all, str) or isinstance(self.evolve_all, unicode):
Copy link
Member

Choose a reason for hiding this comment

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

Check if both are an instance of basestring instead. str and unicode inherits from basestring.

self.evolve_all = [str(pokemon_name) for pokemon_name in self.evolve_all.split(',')]

def work(self):
Expand Down