Initial port to python3
[htsworkflow.git] / htsworkflow / util / alphanum.py
index c9d66495e76fe672a5c41019ce378358c4ee736b..9413f492248cfc8d4f8e9b49f1b0206c9079bc12 100644 (file)
@@ -35,12 +35,12 @@ def chunkify(str):
     return a list of numbers and non-numeric substrings of +str+
     the numeric substrings are converted to integer, non-numeric are left as is
     """
-    if type(str) in types.StringTypes:
+    if type(str) in str:
         chunks = re.findall("(\d+|\D+)",str)
         #convert numeric strings to numbers
         chunks = [re.match('\d',x) and int(x) or x for x in chunks]
         return chunks
-    elif type(str) in [types.IntType, types.LongType, types.FloatType]:
+    elif type(str) in [int, int, float]:
         return [str]
     else:
         raise ValueError("Unsupported type %s for input %s" % (type(str), str))