Index: python/lib/aubio/midiconv.py
===================================================================
--- python/lib/aubio/midiconv.py	(revision 11758834ba430d299e33cc42b0d81257f139451b)
+++ python/lib/aubio/midiconv.py	(revision 2e4ae1df05117da3dbe3793d2289116bf11a9a4c)
@@ -7,7 +7,9 @@
     _valid_octaves = range(-1, 10)
     if type(note) not in (str, unicode):
-        raise TypeError, "a string is required, got %s" % note
+        raise TypeError("a string is required, got %s" % note)
     if not (1 < len(note) < 5):
-        raise ValueError, "string of 2 to 4 characters expected, got %d (%s)" % (len(note), note)
+        raise ValueError(
+                "string of 2 to 4 characters expected, got %d (%s)" %
+                (len(note), note))
     notename, modifier, octave = [None]*3
 
@@ -27,13 +29,13 @@
 
     if notename not in _valid_notenames:
-        raise ValueError, "%s is not a valid note name" % notename
+        raise ValueError("%s is not a valid note name" % notename)
     if modifier not in _valid_modifiers:
-        raise ValueError, "%s is not a valid modifier" % modifier
+        raise ValueError("%s is not a valid modifier" % modifier)
     if octave not in _valid_octaves:
-        raise ValueError, "%s is not a valid octave" % octave
+        raise ValueError("%s is not a valid octave" % octave)
 
     midi = 12 + octave * 12 + _valid_notenames[notename] + _valid_modifiers[modifier]
     if midi > 127:
-        raise ValueError, "%s is outside of the range C-2 to G8" % note
+        raise ValueError("%s is outside of the range C-2 to G8" % note)
     return midi
 
@@ -41,7 +43,8 @@
     " convert midi note number to note name, e.g. [0, 127] -> [C-1, G9] "
     if type(midi) != int:
-        raise TypeError, "an integer is required, got %s" % midi
+        raise TypeError("an integer is required, got %s" % midi)
     if not (-1 < midi < 128):
-        raise ValueError, "an integer between 0 and 127 is excepted, got %d" % midi
+        raise ValueError(
+                "an integer between 0 and 127 is excepted, got %d" % midi)
     midi = int(midi)
     _valid_notenames = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
Index: python/lib/gen_pyobject.py
===================================================================
--- python/lib/gen_pyobject.py	(revision 11758834ba430d299e33cc42b0d81257f139451b)
+++ python/lib/gen_pyobject.py	(revision 2e4ae1df05117da3dbe3793d2289116bf11a9a4c)
@@ -71,5 +71,5 @@
     returns: [['int', 'argc'], ['char **','argv']]
     """
-    return map(split_type, get_params(proto)) 
+    return list(map(split_type, get_params(proto)))
 
 def get_return_type(proto):
Index: python/lib/generator.py
===================================================================
--- python/lib/generator.py	(revision 11758834ba430d299e33cc42b0d81257f139451b)
+++ python/lib/generator.py	(revision 2e4ae1df05117da3dbe3793d2289116bf11a9a4c)
@@ -4,5 +4,5 @@
 
 import os, sys, shutil
-from gen_pyobject import write_msg, gen_new_init, gen_do, gen_members, gen_methods, gen_finish
+from .gen_pyobject import write_msg, gen_new_init, gen_do, gen_members, gen_methods, gen_finish
 
 def get_cpp_objects():
@@ -12,4 +12,5 @@
   cpp_output = filter(lambda y: len(y) > 1, cpp_output)
   cpp_output = filter(lambda y: not y.startswith('#'), cpp_output)
+  cpp_output = list(cpp_output)
 
   i = 1
@@ -86,7 +87,9 @@
       object_methods = [a.strip() for a in object_methods]
       object_methods = filter(lambda x: not x.startswith('typedef'), object_methods)
+      object_methods = list(object_methods)
       #for method in object_methods:
       #    write_msg(method)
-      new_methods = filter(lambda x: 'new_'+object_name in x, object_methods)
+      new_methods = list(filter(
+          lambda x: 'new_'+object_name in x, object_methods))
       if len(new_methods) > 1:
           write_msg("-- WARNING: more than one new method for", object_name)
@@ -99,5 +102,6 @@
               write_msg(method)
 
-      del_methods = filter(lambda x: 'del_'+object_name in x, object_methods)
+      del_methods = list(filter(
+          lambda x: 'del_'+object_name in x, object_methods))
       if len(del_methods) > 1:
           write_msg("-- WARNING: more than one del method for", object_name)
@@ -107,5 +111,6 @@
           write_msg("-- WARNING: no del method for", object_name)
 
-      do_methods = filter(lambda x: object_name+'_do' in x, object_methods)
+      do_methods = list(filter(
+          lambda x: object_name+'_do' in x, object_methods))
       if len(do_methods) > 1:
           pass
@@ -136,4 +141,5 @@
       other_methods = filter(lambda x: x not in get_methods, other_methods)
       other_methods = filter(lambda x: x not in set_methods, other_methods)
+      other_methods = list(other_methods)
 
       if len(other_methods) > 0:
