Convert alphanum sort from comparitor to key operator
[htsworkflow.git] / htsworkflow / pipelines / genome_mapper.py
index 83bdecb2cda88de376c114108a29a3c385053303..fc70590d73247c78ab7f57370eadf63b31db0835 100644 (file)
@@ -6,7 +6,7 @@ import re
 
 import logging
 
-from htsworkflow.util.alphanum import alphanum
+from htsworkflow.util.alphanum import natural_sort_key
 
 LOGGER = logging.getLogger(__name__)
 class DuplicateGenome(Exception): pass
@@ -89,7 +89,7 @@ class constructMapperDict(object):
 
           # sort build names the way humans would
           keys = builds.keys()
-          keys.sort(cmp=alphanum)
+          keys.sort(key=natural_sort_key)
 
           # return the path from the 'last' build name
           return builds[keys[-1]]