Skip to content

Commit

Permalink
Fix incorrect and inconsistent timeout types
Browse files Browse the repository at this point in the history
  • Loading branch information
revolter committed May 15, 2023
1 parent e432c29 commit d295098
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions telegram/_bot.py
Expand Up @@ -3586,7 +3586,7 @@ async def get_updates(
self,
offset: int = None,
limit: int = None,
timeout: float = None,
timeout: int = None,
allowed_updates: Sequence[str] = None,
*,
read_timeout: float = 2,
Expand Down Expand Up @@ -3661,7 +3661,7 @@ async def get_updates(
await self._post(
"getUpdates",
data,
read_timeout=read_timeout + timeout if timeout else read_timeout,
read_timeout=read_timeout + float(timeout) if timeout else read_timeout,
write_timeout=write_timeout,
connect_timeout=connect_timeout,
pool_timeout=pool_timeout,
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_application.py
Expand Up @@ -673,7 +673,7 @@ def run_polling(
Args:
poll_interval (:obj:`float`, optional): Time to wait between polling updates from
Telegram in seconds. Default is ``0.0``.
timeout (:obj:`float`, optional): Passed to
timeout (:obj:`int`, optional): Passed to
:paramref:`telegram.Bot.get_updates.timeout`. Default is ``10`` seconds.
bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase of the
:class:`telegram.ext.Updater` will retry on failures on the Telegram server.
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_extbot.py
Expand Up @@ -531,7 +531,7 @@ async def get_updates(
self,
offset: int = None,
limit: int = None,
timeout: float = None,
timeout: int = None,
allowed_updates: Sequence[str] = None,
*,
read_timeout: float = 2,
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_updater.py
Expand Up @@ -202,7 +202,7 @@ async def start_polling(
Args:
poll_interval (:obj:`float`, optional): Time to wait between polling updates from
Telegram in seconds. Default is ``0.0``.
timeout (:obj:`float`, optional): Passed to
timeout (:obj:`int`, optional): Passed to
:paramref:`telegram.Bot.get_updates.timeout`. Defaults to ``10`` seconds.
bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase of the
:class:`telegram.ext.Updater` will retry on failures on the Telegram server.
Expand Down

0 comments on commit d295098

Please sign in to comment.