From e92bbf386f4a02e584cdd64076b028f25ee7c88b Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 30 Apr 2016 19:07:33 +0000 Subject: [PATCH] britney_util: Replace broken if with an assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace a "if" with an unconditionally false condition with a negative assert of the "correct" condition. The bug has been present for 2½ years with no known adverse effects. Signed-off-by: Niels Thykier --- britney_util.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/britney_util.py b/britney_util.py index 8876c1c..544e5ab 100644 --- a/britney_util.py +++ b/britney_util.py @@ -148,9 +148,7 @@ def undo_changes(lundo, inst_tester, sources, binaries, all_binary_packages, inst_tester.remove_testing_binary(binary, version, arch) else: binaries_t_a = binaries['testing'][arch][0] - if p in binaries_t_a: - rmpkgdata = binaries_t_a[p] - inst_tester.remove_testing_binary((binary, rmpkgdata.version, arch)) + assert binary not in binaries_t_a pkgdata = all_binary_packages[undo['binaries'][p]] binaries_t_a[binary] = pkgdata inst_tester.add_testing_binary((binary, pkgdata.version, arch))