1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fixed failing test cases because of iteritems()

This commit is contained in:
pieter 2015-09-08 22:31:02 +02:00
parent f2971c5d6c
commit 55053fe413

View File

@ -5,6 +5,7 @@ import threading
import time import time
import re import re
import sys import sys
import six
import logging import logging
logger = logging.getLogger('TeleBot') logger = logging.getLogger('TeleBot')
@ -87,7 +88,7 @@ class TeleBot:
Registered listeners and applicable message handlers will be notified when a new message arrives. Registered listeners and applicable message handlers will be notified when a new message arrives.
:raises ApiException when a call has failed. :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 = [] new_messages = []
for update in updates: for update in updates:
if update.update_id > self.last_update_id: if update.update_id > self.last_update_id:
@ -418,7 +419,7 @@ class TeleBot:
@staticmethod @staticmethod
def _test_message_handler(message_handler, message): 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): if not TeleBot._test_filter(filter, filter_value, message):
return False return False
return True return True