]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/queue.py
Replace map() calls with list comprehension instead.
[dak.git] / daklib / queue.py
index 72d226ad21923fdffdd44fe07b0523b27505b5cb..13409eb4d96effc89e750ec17c1d5366c8b9711d 100644 (file)
@@ -19,7 +19,7 @@
 
 ###############################################################################
 
-import cPickle, errno, os, pg, re, stat, string, sys, time
+import cPickle, errno, os, pg, re, stat, sys, time
 import apt_inst, apt_pkg
 import utils, database
 
@@ -699,7 +699,7 @@ distribution."""
             q = self.projectB.query(que)
 
             # Reduce the query results to a list of version numbers
-            ql = map(lambda x: x[0], q.getresult())
+            ql = [ i[0] for i in q.getresult() ]
 
             # Try (1)
             if source_version in ql:
@@ -788,8 +788,8 @@ distribution."""
 
         # Check versions for each target suite
         for target_suite in self.pkg.changes["distribution"].keys():
-            must_be_newer_than = map(string.lower, self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeNewerThan" % (target_suite)))
-            must_be_older_than = map(string.lower, self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeOlderThan" % (target_suite)))
+            must_be_newer_than = [ i.lower for i in self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeNewerThan" % (target_suite)) ]
+            must_be_older_than = [ i.lower for i in self.Cnf.ValueList("Suite::%s::VersionChecks::MustBeOlderThan" % (target_suite)) ]
             # Enforce "must be newer than target suite" even if conffile omits it
             if target_suite not in must_be_newer_than:
                 must_be_newer_than.append(target_suite)