[processing] Update the comparison implementation in voronoi.py (fixes #18219)

When "translating" the cmp function of Site and Halfedge to Python 3, the __lt__ function was forgotten.  It has been added.
This commit is contained in:
Håvard Tveite 2018-08-07 20:48:26 +02:00 committed by Nyall Dawson
parent 8700037725
commit ca0017410b

6
python/plugins/processing/algs/qgis/voronoi.py Normal file → Executable file
View File

@ -397,7 +397,7 @@ class Site(object):
return False
elif self.x < other.x:
return True
elif self.x > other.x:
else:
return False
def distance(self, other):
@ -512,7 +512,7 @@ class Halfedge(object):
return False
elif self.vertex.x < other.vertex.x:
return True
elif self.vertex.x > other.vertex.x:
else:
return False
def leftreg(self, default):
@ -905,4 +905,4 @@ def cmp(a, b):
In python 2 cmp() was a built in function but in python 3 is gone.
"""
return (a > b) - (a < b)
return (b < a) - (a < b)