From b523cec22f0367c1e8abb2c86cba6a50d7f088cd Mon Sep 17 00:00:00 2001 From: coder2020official Date: Sat, 1 Oct 2022 22:32:41 +0400 Subject: [PATCH] Improved code readability --- telebot/__init__.py | 3 +-- telebot/async_telebot.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index 9d4c021..1b78cee 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -949,12 +949,11 @@ class TeleBot: if restart_on_change: self._setup_change_detector(path_to_watch) - restart_on_change = False while not self.__stop_polling.is_set(): try: self.polling(non_stop=True, timeout=timeout, long_polling_timeout=long_polling_timeout, - logger_level=logger_level, allowed_updates=allowed_updates, restart_on_change=restart_on_change, + logger_level=logger_level, allowed_updates=allowed_updates, restart_on_change=False, *args, **kwargs) except Exception as e: if logger_level and logger_level >= logging.ERROR: diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index 148bb40..a2efc41 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -350,8 +350,6 @@ class AsyncTeleBot: self._polling = True if restart_on_change: - restart_on_change = False - self._setup_change_detector(path_to_watch) while self._polling: