diff --git a/pyqtgraph/exporters/Exporter.py b/pyqtgraph/exporters/Exporter.py
index 43a8c33035ce8c604c669737c5e31008d51ccdcd..6371a3b973e712c4cafee423a26d26d5cfcb6e81 100644
--- a/pyqtgraph/exporters/Exporter.py
+++ b/pyqtgraph/exporters/Exporter.py
@@ -119,7 +119,7 @@ class Exporter(object):
         else:
             childs = root.childItems()
             rootItem = [root]
-        childs.sort(lambda a,b: cmp(a.zValue(), b.zValue()))
+        childs.sort(key=lambda a: a.zValue())
         while len(childs) > 0:
             ch = childs.pop(0)
             tree = self.getPaintItems(ch)
diff --git a/pyqtgraph/exporters/ImageExporter.py b/pyqtgraph/exporters/ImageExporter.py
index bdb8b9be184cb63331ab686aad272d8e4f3571d0..d1d78e7ddd367f0a87b84d8b0caef65ca29e0ef1 100644
--- a/pyqtgraph/exporters/ImageExporter.py
+++ b/pyqtgraph/exporters/ImageExporter.py
@@ -42,7 +42,7 @@ class ImageExporter(Exporter):
     
     def export(self, fileName=None, toBytes=False, copy=False):
         if fileName is None and not toBytes and not copy:
-            filter = ["*."+str(f) for f in QtGui.QImageWriter.supportedImageFormats()]
+            filter = ["*."+bytes(f).decode('UTF-8') for f in QtGui.QImageWriter.supportedImageFormats()]
             preferred = ['*.png', '*.tif', '*.jpg']
             for p in preferred[::-1]:
                 if p in filter:
diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py
index be0d86e58b2647482b63ea3d223cd49a5d3803d9..81f9e1637712c356c1af502eb9fde35c62a6dd41 100644
--- a/pyqtgraph/flowchart/Flowchart.py
+++ b/pyqtgraph/flowchart/Flowchart.py
@@ -376,10 +376,10 @@ class Flowchart(Node):
             #tdeps[t] = lastNode
             if lastInd is not None:
                 dels.append((lastInd+1, t))
-        dels.sort(lambda a,b: cmp(b[0], a[0]))
+        #dels.sort(lambda a,b: cmp(b[0], a[0]))
+        dels.sort(key=lambda a: a[0], reverse=True)
         for i, t in dels:
             ops.insert(i, ('d', t))
-            
         return ops
         
         
@@ -491,7 +491,8 @@ class Flowchart(Node):
                 self.clear()
             Node.restoreState(self, state)
             nodes = state['nodes']
-            nodes.sort(lambda a, b: cmp(a['pos'][0], b['pos'][0]))
+            #nodes.sort(lambda a, b: cmp(a['pos'][0], b['pos'][0]))
+            nodes.sort(key=lambda a: a['pos'][0])
             for n in nodes:
                 if n['name'] in self._nodes:
                     #self._nodes[n['name']].graphicsItem().moveBy(*n['pos'])
diff --git a/pyqtgraph/opengl/GLViewWidget.py b/pyqtgraph/opengl/GLViewWidget.py
index d8f70055f0edcc0433ccc19fda20ef5b57c69fc4..fe52065a97a566148dc79e3bf0110378c53998ba 100644
--- a/pyqtgraph/opengl/GLViewWidget.py
+++ b/pyqtgraph/opengl/GLViewWidget.py
@@ -167,7 +167,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
         else:
             items = item.childItems()
             items.append(item)
-        items.sort(lambda a,b: cmp(a.depthValue(), b.depthValue()))
+        items.sort(key=lambda a: a.depthValue())
         for i in items:
             if not i.visible():
                 continue