From 7b880af0ad2e6e0703d8aba179d2f795e34cfdd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 4 May 2017 11:26:01 +0200 Subject: [PATCH] pkgset: Remove use of undefined variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As long as the assertion is not violated, this would not be a problem as the second argument is not evaluated. However if the condition was broken, a NameError would be raised instead of AssertionError with a nice message. Signed-off-by: Lubomír Sedlář --- pungi/phases/pkgset/sources/source_koji.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index 8f275ad3..5e6b2e56 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -96,8 +96,7 @@ def get_module(session, module_info, strict=False): # returned, but otherwise we have to pick the one with the highest # release ourselves. if 'variant_release' in query: - assert len(retval) <= 1, compose.log_error( - "More than one module returned from PDC: %s" % str(retval)) + assert len(retval) <= 1, "More than one module returned from PDC: %s" % retval module = retval[0] else: module = retval[0]