From 55053fe4132fb6492c16092671d9646cab82c964 Mon Sep 17 00:00:00 2001 From: pieter Date: Tue, 8 Sep 2015 22:31:02 +0200 Subject: [PATCH] Fixed failing test cases because of iteritems() --- telebot/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index 725981a..c05c394 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -5,6 +5,7 @@ import threading import time import re import sys +import six import logging logger = logging.getLogger('TeleBot') @@ -87,7 +88,7 @@ class TeleBot: Registered listeners and applicable message handlers will be notified when a new message arrives. :raises ApiException when a call has failed. """ - updates = self.get_updates(offset=(self.last_update_id + 1), timeout=20) + updates = self.get_updates(offset=(self.last_update_id + 1), timeout=3) new_messages = [] for update in updates: if update.update_id > self.last_update_id: @@ -418,7 +419,7 @@ class TeleBot: @staticmethod def _test_message_handler(message_handler, message): - for filter, filter_value in message_handler['filters'].iteritems(): + for filter, filter_value in six.iteritems(message_handler['filters']): if not TeleBot._test_filter(filter, filter_value, message): return False return True