]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/rpm_builder.py
- more python3 fixes, dropped python2 support
[tld-builder.git] / TLD_Builder / rpm_builder.py
index f9f4ddaadeda38f5de59d8f65d56c9c2cccd06c2..e33a7e1ff325a55557ec5607b479d022c8d61a73 100644 (file)
@@ -51,7 +51,7 @@ def pick_request(q):
             return cmp(r1.time, r2.time)
         else:
             return pri_diff
-    q.requests.sort(mycmp)
+    q.requests.sort(key=util.cmp_to_key(mycmp))
     ret = q.requests[0]
     return ret
 
@@ -85,7 +85,7 @@ def check_skip_build(r, b):
     return False
 
 def fetch_src(r, b):
-    src_url = config.control_url + "/srpms/" + r.id + "/" + urllib.quote(b.src_rpm)
+    src_url = config.control_url + "/srpms/" + r.id + "/" + urllib.parse.quote(b.src_rpm)
     b.log_line("fetching %s" % src_url)
     start = time.time()
     good = False
@@ -126,7 +126,7 @@ def fetch_src(r, b):
                     print("error.reason exception %s" % e)
                 raise
 
-    o = chroot.popen("cat > %s" % b.src_rpm, mode = "w")
+    o = chroot.popen("cat > %s" % b.src_rpm, mode = "wb")
 
     try:
         bytes = util.sendfile(f, o)