mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-22 00:44:00 +01:00
Catch NoneType in helpers.py/multikeysort
This commit is contained in:
@@ -52,7 +52,14 @@ def cmp(x, y):
|
|||||||
|
|
||||||
https://portingguide.readthedocs.io/en/latest/comparisons.html#the-cmp-function
|
https://portingguide.readthedocs.io/en/latest/comparisons.html#the-cmp-function
|
||||||
"""
|
"""
|
||||||
return (x > y) - (x < y)
|
if x is None and y is None:
|
||||||
|
return 0
|
||||||
|
elif x is None:
|
||||||
|
return -1
|
||||||
|
elif y is None:
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return (x > y) - (x < y)
|
||||||
|
|
||||||
def multikeysort(items, columns):
|
def multikeysort(items, columns):
|
||||||
comparers = [
|
comparers = [
|
||||||
|
|||||||
Reference in New Issue
Block a user