From 1bcb2a1d935527faead4e9c3dbea0935f7608443 Mon Sep 17 00:00:00 2001 From: _run Date: Sun, 11 Aug 2024 16:36:34 +0500 Subject: [PATCH 1/2] Revert "Use deepcopy for async" This reverts commit 74019d03afe7f0e0f4248c0cdf34655617256045. --- telebot/async_telebot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index 27b861ead..d50cbf7e0 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -32,7 +32,7 @@ import string import random import ssl -import copy + """ Module : telebot @@ -558,7 +558,7 @@ async def _run_middlewares_and_handlers(self, message, handlers, middlewares, up logger.error("It is not allowed to pass data and values inside data to the handler. Check your handler: {}".format(handler['function'])) return else: - data_copy = copy.deepcopy(data) + data_copy = data.copy() for key in list(data_copy): # remove data from data_copy if handler does not accept it if key not in params: From c79e63e3b300508f3e99b2ad841cc1889f9c6bc2 Mon Sep 17 00:00:00 2001 From: _run Date: Sun, 11 Aug 2024 16:36:41 +0500 Subject: [PATCH 2/2] Revert "Use deepcopy for sync" This reverts commit 2ae6b9308e05dff5632f2e6bf91301b74d5cb7fc. --- telebot/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index 671c5631b..b154d04ca 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -20,7 +20,6 @@ # random module to generate random string import random import string -import copy import ssl @@ -8750,7 +8749,7 @@ def _run_middlewares_and_handler(self, message, handlers, middlewares, update_ty logger.error("It is not allowed to pass data and values inside data to the handler. Check your handler: {}".format(handler['function'])) return else: - data_copy = copy.deepcopy(data) + data_copy = data.copy() for key in list(data_copy): # remove data from data_copy if handler does not accept it if key not in params: