From beab35c853e2f374f402276ca78a0fc779369c3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 17 Jan 2021 19:55:36 +0100 Subject: [PATCH] Make sure filter and map results are always lists (not true in py3 :/) --- PLD_Builder/request.py | 6 +++--- PLD_Builder/request_handler.py | 4 ++-- PLD_Builder/rpm_builder.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PLD_Builder/request.py b/PLD_Builder/request.py index 6678591..eff30a2 100644 --- a/PLD_Builder/request.py +++ b/PLD_Builder/request.py @@ -421,7 +421,7 @@ class Batch: # map them to poldek ignores # always ignore hhvm res = ['hhvm-*'] - for v in map(php_ver_to_name, php_versions): + for v in list(map(php_ver_to_name, php_versions)): res.append("php%s-*" % v) return res @@ -447,7 +447,7 @@ class Batch: def add_ignore(s): return "--ignore=%s" % s - return " ".join(map(add_ignore, ignores)) + return " ".join(list(map(add_ignore, ignores))) def kernel_string(self): r = "" @@ -492,7 +492,7 @@ class Batch: %s %s %s\n""" % (self.b_id, - string.join(map(lambda (b): b.b_id, self.depends_on)), + string.join(list(map(lambda (b): b.b_id, self.depends_on))), escape(self.src_rpm), escape(' '.join(self.command_flags)), escape(self.command), escape(self.spec), escape(self.branch), escape(self.info))) diff --git a/PLD_Builder/request_handler.py b/PLD_Builder/request_handler.py index 2307607..4b2b9dd 100644 --- a/PLD_Builder/request_handler.py +++ b/PLD_Builder/request_handler.py @@ -159,7 +159,7 @@ def handle_notification(r, user): q = B_Queue(path.req_queue_file) q.lock(0) q.read() - not_fin = filter(lambda (r): not r.is_done(), q.requests) + not_fin = list(filter(lambda (r): not r.is_done(), q.requests)) r.apply_to(q) for r in not_fin: if r.is_done(): @@ -174,7 +174,7 @@ def handle_notification(r, user): util.clean_tmp(path.srpms_dir + '/' + r.id) return False return True - q.requests = filter(leave_it, q.requests) + q.requests = list(filter(leave_it, q.requests)) q.write() q.dump(path.queue_stats_file) q.dump_html(path.queue_html_stats_file) diff --git a/PLD_Builder/rpm_builder.py b/PLD_Builder/rpm_builder.py index 7b5230b..08f63e2 100644 --- a/PLD_Builder/rpm_builder.py +++ b/PLD_Builder/rpm_builder.py @@ -411,7 +411,7 @@ def main_for(builder): q.lock(0) q.read() previouslen=len(q.requests) - q.requests=filter(otherreqs, q.requests) + q.requests=list(filter(otherreqs, q.requests)) if len(q.requests)