From c3692fd12472f703fbabad1ed5f564824e2afba4 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 20 Jul 2018 00:01:01 +0200 Subject: [PATCH] Fix infinite recursion --- telethon/network/mtprotosender.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/network/mtprotosender.py b/telethon/network/mtprotosender.py index 17a73171..800f142d 100644 --- a/telethon/network/mtprotosender.py +++ b/telethon/network/mtprotosender.py @@ -772,7 +772,10 @@ class _ContainerQueue(queue.Queue): # # To work around that issue, always convert the result to # a list, so if it's a list, we don't need to do anything. - items = self.get_nowait() + # + # Changed to .get(block=False) which is what + # .get_nowait() does to avoid infinite recursion. + items = super().get(block=False) if not isinstance(items, list): items = [items]