Catch NoneType in helpers.py/multikeysort

This commit is contained in:
rembo10
2022-02-07 08:02:32 +05:30
parent a3db89c11d
commit e2db680b9e

View File

@@ -52,7 +52,14 @@ def cmp(x, y):
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):
comparers = [