]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
Make sure filter and map results are always lists (not true in py3 :/)
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 17 Jan 2021 18:55:36 +0000 (19:55 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 17 Jan 2021 18:55:36 +0000 (19:55 +0100)
PLD_Builder/request.py
PLD_Builder/request_handler.py
PLD_Builder/rpm_builder.py

index 667859129bd15449476d89c8b8eb7cef00d03fa4..eff30a223f8579e21948423e99879b525a32b19f 100644 (file)
@@ -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:
            <spec>%s</spec>
            <branch>%s</branch>
            <info>%s</info>\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)))
index 2307607f26d469564713393e6cb8d3e1e0c7d180..4b2b9ddf54b5a92efde6ac64d0bfd2507f76cb2a 100644 (file)
@@ -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)
index 7b5230be03621db5f35c4347333683112b331e8a..08f63e2c4b00cdb6ff81c0861913b71e47ca0a47 100644 (file)
@@ -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)<previouslen:
         q.write()
     q.unlock()
This page took 0.362861 seconds and 4 git commands to generate.