Skip to content

Commit

Permalink
python3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jlmadurga committed Apr 25, 2016
1 parent e029800 commit 142d5de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions microbot/models/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from rest_framework.status import is_success
from microbot import caching
from telegram import emoji
from six import iteritems
from six import iteritems, PY2

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -152,7 +152,9 @@ def _create_emoji_context(self):
context = {}
for key, value in iteritems(emoji.Emoji.__dict__):
if '__' not in key:
context[key.lower().replace(" ", "_")] = value.decode('utf-8')
if PY2:
value = value.decode('utf-8')
context[key.lower().replace(" ", "_")] = value
return context

def process(self, bot, message, service, state_context, **pattern_context):
Expand Down

0 comments on commit 142d5de

Please sign in to comment.