From a12dad724102eedec88fbd1933fa2d79c2e29cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 30 Nov 2018 17:13:31 +0000 Subject: [PATCH] xep_0384: Fixup; get check for eligible devices out of the loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.py b/plugin.py index f9a9c9e..9cc5519 100644 --- a/plugin.py +++ b/plugin.py @@ -313,8 +313,8 @@ class XEP_0384(BasePlugin): if not errors: break + no_eligible_devices = [] for (exn, key, val) in errors: - no_eligible_devices = [] if isinstance(exn, MissingBundleException): bundle = await self._fetch_bundle(key, val) @@ -338,8 +338,8 @@ class XEP_0384(BasePlugin): no_eligible_devices.append(key) - if no_eligible_devices: - raise NoEligibleDevices(no_eligible_devices) + if no_eligible_devices: + raise NoEligibleDevices(no_eligible_devices) break