From 5310c55a936a5c2f03daaf5325bd40bbc0719da9 Mon Sep 17 00:00:00 2001 From: Dan Elkouby Date: Sat, 5 May 2018 16:03:49 +0300 Subject: [PATCH] Use a reversed range instead of while --- uniborg/uniborg.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/uniborg/uniborg.py b/uniborg/uniborg.py index 4afbfb8..0a1706a 100644 --- a/uniborg/uniborg.py +++ b/uniborg/uniborg.py @@ -79,9 +79,7 @@ class Uniborg(TelegramClient): def remove_plugin(self, shortname): name = self._plugins[shortname].__name__ - i = len(self._event_builders) - while i: - i -= 1 + for i in reversed(range(len(self._event_builders))): ev, cb = self._event_builders[i] if cb.__module__ == name: del self._event_builders[i]