Skip to content

Commit 42bef47

Browse files
authored
Merge pull request #2363 from coder2020official/middlewares
Revert changes to middlewares
2 parents 21e92fb + c79e63e commit 42bef47

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

telebot/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
# random module to generate random string
2121
import random
2222
import string
23-
import copy
2423

2524
import ssl
2625

@@ -8865,7 +8864,7 @@ def _run_middlewares_and_handler(self, message, handlers, middlewares, update_ty
88658864
logger.error("It is not allowed to pass data and values inside data to the handler. Check your handler: {}".format(handler['function']))
88668865
return
88678866
else:
8868-
data_copy = copy.deepcopy(data)
8867+
data_copy = data.copy()
88698868
for key in list(data_copy):
88708869
# remove data from data_copy if handler does not accept it
88718870
if key not in params:

telebot/async_telebot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import string
3333
import random
3434
import ssl
35-
import copy
35+
3636

3737
"""
3838
Module : telebot
@@ -570,7 +570,7 @@ async def _run_middlewares_and_handlers(self, message, handlers, middlewares, up
570570
logger.error("It is not allowed to pass data and values inside data to the handler. Check your handler: {}".format(handler['function']))
571571
return
572572
else:
573-
data_copy = copy.deepcopy(data)
573+
data_copy = data.copy()
574574
for key in list(data_copy):
575575
# remove data from data_copy if handler does not accept it
576576
if key not in params:

0 commit comments

Comments
 (0)