From 8e3862112ce5a7176c90224ee416a40a7ef3fbc3 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 7 Jul 2017 12:59:25 +0200 Subject: [PATCH] libkas: Fix false positive of pylint As suggested by Claudius Heine, reorder the blocks so that we can add the pylint exception to the if half. Signed-off-by: Jan Kiszka --- kas/libkas.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kas/libkas.py b/kas/libkas.py index 30c7c06..2bfeaab 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -210,10 +210,11 @@ def repos_fetch(config, repos): """ tasks = [] for repo in repos: - if hasattr(asyncio, 'ensure_future'): - task = asyncio.ensure_future(_repo_fetch_async(config, repo)) - else: + if not hasattr(asyncio, 'ensure_future'): + # pylint: disable=no-member,deprecated-method task = asyncio.async(_repo_fetch_async(config, repo)) + else: + task = asyncio.ensure_future(_repo_fetch_async(config, repo)) tasks.append(task) loop = asyncio.get_event_loop()