mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 12:25:45 +01:00
Merge branch 'master' of github.com:leandrotoledo/python-telegram-bot into boteventhandler
This commit is contained in:
commit
45712c52f1
4 changed files with 10 additions and 9 deletions
|
@ -1 +1 @@
|
|||
include LICENSE LICENSE.lesser Makefile
|
||||
include LICENSE LICENSE.lesser Makefile requirements.txt
|
||||
|
|
|
@ -58,7 +58,7 @@ author = u'Leandro Toledo'
|
|||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '2.9.1'
|
||||
version = '2.9'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '2.9.1'
|
||||
|
||||
|
|
|
@ -667,10 +667,10 @@ class Bot(TelegramObject):
|
|||
Timeout in seconds for long polling. Defaults to 0, i.e. usual
|
||||
short polling.
|
||||
network_delay:
|
||||
Additional timeout in seconds to allow the response from Telegram to
|
||||
take some time when using long polling. Defaults to 2, which should
|
||||
be enough for most connections. Increase it if it takes very long
|
||||
for data to be transmitted from and to the Telegram servers.
|
||||
Additional timeout in seconds to allow the response from Telegram
|
||||
to take some time when using long polling. Defaults to 2, which
|
||||
should be enough for most connections. Increase it if it takes very
|
||||
long for data to be transmitted from and to the Telegram servers.
|
||||
|
||||
Returns:
|
||||
A list of telegram.Update objects are returned.
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
"""This module contains methods to make POST and GET requests"""
|
||||
|
||||
import json
|
||||
import socket
|
||||
from ssl import SSLError
|
||||
|
||||
try:
|
||||
|
@ -111,11 +112,11 @@ def post(url,
|
|||
|
||||
message = _parse(error.read())
|
||||
raise TelegramError(message)
|
||||
except SSLError as error:
|
||||
if "operation timed out" in error.message:
|
||||
except (SSLError, socket.timeout) as error:
|
||||
if "operation timed out" in str(error):
|
||||
raise TelegramError("Timed out")
|
||||
|
||||
raise TelegramError(error.message)
|
||||
raise TelegramError(str(error))
|
||||
return _parse(result)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue