From 1518be0b95304ecb9c5692c973fbaa4d5d46c0b0 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 28 Sep 2017 09:30:47 +0200 Subject: [PATCH] Use .appendleft(x) for deque instead .insert(0, x) (fix #268) --- telethon/update_state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/update_state.py b/telethon/update_state.py index e92dac1f..c38d6ebf 100644 --- a/telethon/update_state.py +++ b/telethon/update_state.py @@ -57,7 +57,7 @@ class UpdateState: with self._updates_lock: # Insert at the beginning so the very next poll causes an error # TODO Should this reset the pts and such? - self._updates.insert(0, error) + self._updates.appendleft(error) self._updates_available.set() def check_error(self):