Skip to content
Permalink
Browse files

[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.
  • Loading branch information
havatv authored and nyalldawson committed Aug 7, 2018
1 parent 8700037 commit ca0017410b8446c160b51121e546ac5fb118e6f0
Showing with 3 additions and 3 deletions.
  1. +3 −3 python/plugins/processing/algs/qgis/voronoi.py
@@ -397,7 +397,7 @@ def __lt__(self, other):
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 @@ def __lt__(self, other):
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)

0 comments on commit ca00174

Please sign in to comment.
You can’t perform that action at this time.