diff options
Diffstat (limited to 'deluge/ui/gtk3/common.py')
-rw-r--r-- | deluge/ui/gtk3/common.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/deluge/ui/gtk3/common.py b/deluge/ui/gtk3/common.py index 0be3bff35..743417284 100644 --- a/deluge/ui/gtk3/common.py +++ b/deluge/ui/gtk3/common.py @@ -42,7 +42,18 @@ def cmp(x, y): and strictly positive if x > y. """ - return (x > y) - (x < y) + try: + return (x > y) - (x < y) + except TypeError: + # Handle NoneType comparison + if x is None: + if y is None: + return 0 + return -1 + elif y is None: + return 1 + else: + raise def create_blank_pixbuf(size=16): |