diff --git a/terminatorlib/layoutlauncher.py b/terminatorlib/layoutlauncher.py index b4981748..6045b041 100755 --- a/terminatorlib/layoutlauncher.py +++ b/terminatorlib/layoutlauncher.py @@ -72,7 +72,7 @@ class LayoutLauncher: """Update the contents of the layout""" self.layouttreestore.clear() layouts = self.config.list_layouts() - for layout in sorted(layouts, cmp=lambda x,y: cmp(x.lower(), y.lower())): + for layout in sorted(layouts, key=str.lower): if layout != "default": self.layouttreestore.append([layout]) else: diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 000d6f97..6f32cd3b 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -3,6 +3,7 @@ # GPL v2 only """notebook.py - classes for the notebook widget""" +from functools import cmp_to_key from gi.repository import GObject from gi.repository import Gtk from gi.repository import Gdk @@ -100,7 +101,7 @@ class Notebook(Container, Gtk.Notebook): num = 0 keys = list(children.keys()) - keys.sort(child_compare) + keys = sorted(keys, key=cmp_to_key(child_compare)) for child_key in keys: child = children[child_key]